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

Zoom out the plot with right mouse drag #24

Open
akhilman opened this issue May 23, 2024 · 1 comment
Open

Zoom out the plot with right mouse drag #24

akhilman opened this issue May 23, 2024 · 1 comment

Comments

@akhilman
Copy link

Currently there is no way to zoom out the plot using only the mouse.
I propose to use dragging from left to right to zoom in and dragging from right to left to zoom out.
So if I draw a rectangle from left to right, the viewport will zoom to fit that rectangle. But if I draw a rectangle from right to left, the viewport zooms out so that the previous viewport will fit that rectangle.
Alternatively it could be top to bottom and bottom to top respectively.

I have seen the same behaviour somewhere, but I cannot remember which application it was.

There is another suggestion about zooming #17

@emilk emilk transferred this issue from emilk/egui Jul 15, 2024
@alexforencich
Copy link

An idea I have seen in several different programs is that the four quadrants (the direction you draw the box) do different things - e.g. zoom in, zoom out, zoom to the boxed region, zoom to the extents. Very convenient setup once you get the hang of it, as no modifier keys are required, only the mouse.

For example, in Xilinx Vivado, dragging NW is zoom fit, NE is zoom out, SW is zoom in, SE is zoom area. A line from the start point to the cursor is drawn for the first three, only zoom area gets a box. For zoom in/zoom out, dragging a longer line results in a bigger zoom (0.5x, 1x, 2x, etc.). All of this is on the left click, right click is a context menu, panning is ctrl+click, scroll wheel scrolls vertically. Block diagrams, schematics, and floor plans all use the same setup.

Another idea: for plots you might want to actually zoom in different directions/different amounts on different axes, instead of a 1:1 zoom which you might want to do on a map or on an image. In pyqtgraph, it's set up like this: left click is pan, right click is context menu and zoom. Right click, release gets you a context menu. Right click, drag zooms, up/down zooms the Y axis, left/right zooms the X axis, up/right to zoom in, down/left to zoom out. The top item in the context menu is "view all" (zoom to extents). Super useful when you have a long time series with little variations that can span many orders of magnitude and you want to zoom in on one little piece of it (such as a slew on the milisecond level followed by an oscillation on the nanosecond level).

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

No branches or pull requests

2 participants