Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a line to the 2nd y-axis doesn't end up there #2412

Closed
SamuMazzi opened this issue Nov 6, 2024 · 0 comments · Fixed by #2414
Closed

Adding a line to the 2nd y-axis doesn't end up there #2412

SamuMazzi opened this issue Nov 6, 2024 · 0 comments · Fixed by #2414
Labels
state: pending not addressed yet type: bug bug

Comments

@SamuMazzi
Copy link
Contributor

Version of Dear PyGui

Version: 2.0.0
Operating System: Ubuntu 24.04

My Issue/Question

If you add a series to another axis which is not the first one, it makes it stick to the first one. The new axis gets created anyway but the series appears to be linked to the first one. This happens only when using dpg.mvYAxis, if explicitly setting the dpg.mvYAxis2/3 this bug doesn't happen.

Steps to reproduce

  1. Go to a plot with two series on two axis (defined with dpg.mvYAxis)
  2. Scroll on Y2 axis and no series will move
  3. Scroll on Y1 axis and both series will move

Video

Video.del.2024-11-06.10-19-56.mp4

Expected behavior

Video.del.2024-11-06.10-11-18.mp4

Standalone, minimal, complete and verifiable example

#!/usr/local/bin/python3

from math import sin
import dearpygui.dearpygui as dpg

dpg.create_context()
dpg.create_viewport(title=f"Test - {dpg.get_dearpygui_version()}", width=500, height=400) 

with dpg.window() as wnd:
    dpg.set_primary_window(dpg.last_item(), True)

    x_data = [x/10 for x in range(0, 200)]
    y_data = [sin(x) for x in x_data]

    with dpg.plot(width=-1, height=-1):
        dpg.add_plot_legend()
        dpg.add_plot_axis(dpg.mvXAxis)

        with dpg.plot_axis(dpg.mvYAxis, label="y", tag="y_axis"):
            dpg.add_line_series(x_data, y_data, label="Bound to Y")
        with dpg.plot_axis(dpg.mvYAxis, label="y2", opposite=True, tag="y_axis2"):
            dpg.add_line_series(x_data[:-10], y_data[10:], label="Bound to Y2")

dpg.setup_dearpygui()
dpg.show_viewport()
dpg.start_dearpygui()
dpg.destroy_context()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state: pending not addressed yet type: bug bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant