Synopsis
Zoom into or out of a plot by a fixed amount.
Syntax
zoom(scale) zooom(cid, scale)
Description
The function arguments.
Argument | Description |
---|---|
scale | The zoom factor to use; a value greater than 1 zooms into the plot and less than 1 out of the plot (the value must be positive). |
cid | A ChipsId structure used to set the plot and pair of axes to use. |
The zoom command allows the user to zoom into or out of a plot, either by a fixed amount or by using the mouse to change the zoom level interactively.
Interactive zoom
Plots can be zoomed into, or panned around, directly from the ChIPS window, as described in the ChIPS GUI documentation.
Bringing up the GUI
The GUI can be launched by right clicking on an existing ChIPS window and selecting "Show GUI", or by running the show_gui command from the ChIPS command line.
Related commands
The pick_limits(), limits(), and panto() commands can also be used to change the limits of the plot.
Examples
Example 1
chips> x = np.arange(0,10,0.1) chips> y = np.tan(x) chips> add_curve(x, y, ["symbol.style", "none"]) chips> limits(0, 10, -40, 90) chips> zoom(2) chips> get_plot_range() [2.5, 7.5, -7.5, 57.5]
Here we create a plot, set the limits and then zoom into it. Using a scale factor of 2 halves the displayed axis range as shown by the output of the get_plot_range call.
Example 2
chips> get_plot_range() [2.5, 7.5, -7.5, 57.5] chips> zoom(0.25) chips> get_plot_range() [-5.0, 15.0, -105.0, 155.0]
By using a scale factor less than 1 the plot limits have increased, this time by a factor of 4.
Bugs
See the bugs pages on the ChIPS website for an up-to-date listing of known bugs.
See Also
- contrib
- chips_utils
- limits
- limits, panto, pick_limits