Repository navigation
fix(signal): keep the X axis aligned with the grid after a refresh - #458
Merged
Merged
Conversation
After opening a signal or changing the selection, the X axis ticks could be shifted relative to the vertical grid lines and the curves, until the view was panned or zoomed, for signals whose X axis does not start and end on a graduation (e.g. step.npy from the Sigima test data). SignalPlotHandler.refresh_plot replaced the bottom scale draw with a new QwtScaleDraw on every refresh, to undo the date/time formatting, even when the X axis was not in date/time mode. PythonQwt laid the new scale draw out before giving it the geometry of the previous one, with border distances differing from those used to draw the grid and the curves (PlotPyStack/PythonQwt#113, fixed by PlotPyStack/PythonQwt#114). - refresh_plot: restore the default scale draw only when leaving the date/time mode, i.e. when the current one is a QwtDateTimeScaleDraw. - Regression tests: X scale draw kept on refresh, X axis aligned with the canvas map, date/time formatting still removed for regular signals. Closes #457 Assisted-by: Claude Opus 5.5
Add the 1.4.0 bug-fix note on the X axis ticks shifted relative to the grid and the curves, and its French translation. Refs #457 Assisted-by: Claude Opus 5.5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #457.
Problem
After opening a signal or changing the selection, the X axis ticks could be shifted relative to the vertical grid lines and the curves, until the view was panned or zoomed. This happened with signals whose X axis does not start and end on a graduation, e.g.
step.npyfrom the Sigima test data (axis drawn between 7 and 503 px, grid and curve between -1 and 509 px).Root cause
SignalPlotHandler.refresh_plotreplaced the bottom scale draw with a newQwtScaleDrawon every refresh, to undo the date/time formatting, even when the X axis was not in date/time mode.master, not released yet).Changes
refresh_plot: restore the default scale draw only when leaving the date/time mode (current scale draw is aQwtDateTimeScaleDraw), so that regular refreshes keep the X axis scale draw.datalab/tests/features/signal/xaxis_scale_draw_unit_test.py: X scale draw kept on refresh, X axis aligned with the canvas map, date/time formatting still removed when showing regular signals.With this change, regular signals are fixed whatever the PythonQwt version. The date/time mode still creates a new scale draw on each refresh, which is fixed by the PythonQwt change.
Tests
developand pass with the fix, both with the installed PythonQwt 0.16.0 and with PythonQwtmaster(including fix(scale_widget): keep scale geometry when replacing the scale draw PlotPyStack/PythonQwt#114).datalab/tests/features/signalanddatalab/tests/features/common: 503 passed, 1 skipped.step.npyis displayed with an X axis aligned with the grid.