Expose `ImPlot::SetAxes()` to allow explicit X/Y axis pairing for plot series
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
Research direction
Start by locating the existing dpg.add_plot_axis() and dpg.add_line_series() entry points and the ImPlot::SetAxes() call described in the issue. Compare the proposed set_plot_axes() method with optional series parameters, while preserving current rank-based behavior. Done means a series can explicitly select X and Y axes and existing users retain the default behavior.
Written by the indexing model from the issue text.
Description
Description
Currently in DearPyGui, series can be added as children of any of the following axes — mvXAxis, mvXAxis2, mvXAxis3, mvYAxis, mvYAxis2, mvYAxis3 — but there is no way to explicitly control the pairing between X and Y axes for a given series.
It is not entirely clear to how DPG assigns axis pairings when multiple axes exist - the behavior appears inconsistent depending on which order the axes were created using dpg.add_plot_axis(), and what the hide/show state is when assigning via dpg.add_line_series(), etc.
It appears that the ImPlot API has supported explicit axis pairing since v0.13 via ImPlot::SetAxes(ImAxis x_idx, ImAxis y_idx), called immediately before each plot call. This is not currently exposed in DPG.
Proposed API
Expose this as an additional DPG method while leaving current default rank-based behavior intact. Users who do not call it get existing behavior. Users who need explicit control can override it:
dpg.set_plot_axes(series_tag, x_axis=dpg.mvXAxis2, y_axis=dpg.mvYAxis1)
Or as optional parameters on series add functions:
dpg.add_line_series(..., x_axis=dpg.mvXAxis2, y_axis=dpg.mvYAxis1)
Use Case
I'm building a multi-axis time series viewer where users drag and drop data columns onto specific axes. With explicit axis pairing exposed, when a user drags a series onto a specific axis I can detect how many alternative axes are currently enabled/visible and prompt the user to select the destination pairing — for example, drag onto Y2 and get a popup asking whether to plot against X1, X2, or X3. This is currently impossible because the pairing is assigned automatically with no way to override it after the fact.
Workarounds
I have not found reliable workarounds for the default behavior
- Dominant language
- C++
- Stars
- 15.7k
- Forks
- 790
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from hoffstadt/DearPyGui
-
Plot series data silently truncated to float32 when passed as numpy array (should be float64/double)Openstate: pending type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
state: pending type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
state: pending type: improvement
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
state: pending type: bug
Difficulty 4/5 3-5 days Newbie friendliness 42/100
-
state: pending type: improvement
Difficulty 5/5 Over a week Newbie friendliness 25/100
All issues in hoffstadt/DearPyGui
Similar issues
-
[Windows] Hidden title bar: a maximized window restored from minimized on a secondary monitor gets the primary monitor's work area as its client areaPossibly taken @lijy91 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
libnativeapi/nativeapi#53 · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
Maintainers usually reply within 1 day
-
bot-triaged module: correctness (silent) module: fft triage review
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
patrickjquinn/Marathon-Shell#84 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 80/100
Maintainers usually reply within 1 day