Skip to content

Move logx, logy, logc, color-autoscale buttons from toolbar to axes#572

Draft
nvaytet wants to merge 18 commits into
mainfrom
log-buttons-per-axis
Draft

Move logx, logy, logc, color-autoscale buttons from toolbar to axes#572
nvaytet wants to merge 18 commits into
mainfrom
log-buttons-per-axis

Conversation

@nvaytet

@nvaytet nvaytet commented Jun 11, 2026

Copy link
Copy Markdown
Member

The logx, logy, log and color-autoscale buttons in the toolbar are designed to act on one axes.
The Home, Pan, Zoom, and Save buttons act on all axes in a subplot.

It was ambiguous what to do with the toolbar buttons when subplots/user-supplied axes/tiled were used.

We now move them to being on the axes themselves, appearing upon hover.

1d plot:
Screenshot_20260611_132415

2d plot:
Screenshot_20260611_132433
Screenshot_20260611_132429

3d plot:
Screenshot_20260611_132511

Note: for 3d plots we replaced the ipywidgets.Image widget with a custom Anywidget because the former does not handle hover or click events.

xlabel: str | None = None,
ylabel: str | None = None,
norm: Literal['linear', 'log'] | None = None,
autoscale_axes: Callable | None = None,

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The View is the one who knows how to properly autoscale the axes because it holds the references to the plotted artists. But the canvas need to call autoscale when the log buttons are clicked. So we pass the callback to the canvas here.

Not the most elegant design but it was the least invasive I could come up with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant