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

dpg.set_axis_ticks() does not work as expected #1855

Closed
sedenka opened this issue Aug 8, 2022 · 2 comments
Closed

dpg.set_axis_ticks() does not work as expected #1855

sedenka opened this issue Aug 8, 2022 · 2 comments
Labels
state: ready Fixed/Added and will be present in an upcoming release type: bug bug

Comments

@sedenka
Copy link

sedenka commented Aug 8, 2022

Version of Dear PyGui

Version: 1.6.3 (master@9989e6f)
Operating System: Windows 10

My Issue/Question

The function dpg.set_axis_ticks() is struggling to recognise proper axis to work with. It was working properly in the 1.6.2 but it is broken in the above-mentioned commit. Moreover, adding a colorbar dpg.add_colormap_scale() causes flipping of the axes (all the ticks are put on the y-axis instead of the x-axis). The issue may be related to #1852.

To Reproduce

Steps to reproduce the behavior:

  1. Run the code
  2. See tick labels

Expected behavior

The code should set tick labels a-c to the y-axis and a-f to the x-axis.

Screenshots/Video

1.6.2 (works as expected):
heatmap_162

1.6.3 (built from source):
heatmap_163

1.6.3 (built from source) with colormap scale modification:
heatmap_163_cbar

Standalone, minimal, complete and verifiable example

# Here's some code anyone can copy and paste to reproduce your issue
import dearpygui.dearpygui as dpg

dpg.create_context()
dpg.create_viewport(width=300, height=200)

values = (0.8, 2.4, 2.5, 3.9, 0.0, 4.0,
          2.4, 0.0, 4.0, 1.0, 2.7, 0.0,
          1.1, 2.4, 0.8, 4.3, 1.9, 4.4,
          0.6, 0.0, 0.3, 0.0, 3.1, 0.0)
xticks = (("a", 0.0), ("b", 0.2), ("c", 0.4), ("d", 0.6), ("e", 0.8), ("f", 1.0))
yticks = (("a", 0.0), ("b", 0.5), ("c", 1.0))

with dpg.window(label="Example Window", tag="Primary"):
    with dpg.plot(height=-1, width=-1):
        xaxis = dpg.add_plot_axis(dpg.mvXAxis, label="x")
        dpg.set_axis_ticks(xaxis, xticks)
        with dpg.plot_axis(dpg.mvYAxis, label="y") as yaxis:
            dpg.set_axis_ticks(yaxis, yticks)
            dpg.add_heat_series(values, 4, 6, scale_min=0, scale_max=6)

dpg.setup_dearpygui()

dpg.show_viewport()
dpg.set_primary_window("Primary", True)
dpg.start_dearpygui()
dpg.destroy_context()

Modified code:

...
with dpg.window(label="Example Window", tag="Primary"):
    with dpg.group(horizontal=True):
        dpg.add_colormap_scale()
        with dpg.plot(height=-1, width=-1):
...
@wlwatkins
Copy link

wlwatkins commented Oct 15, 2022

have you managed to get some new results? i guess looking at #1897 nothing has changed.

although i cannot reproduce the working with your code and v1.6.2

@hoffstadt hoffstadt added state: ready Fixed/Added and will be present in an upcoming release and removed state: pending not addressed yet labels Oct 17, 2022
@hoffstadt
Copy link
Owner

Fixed in next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state: ready Fixed/Added and will be present in an upcoming release type: bug bug
Projects
None yet
Development

No branches or pull requests

3 participants