Synopsis
Set or retrieve the aspect ratio information of the plot.
Syntax
set_plot_aspect_ratio([id], ratio) get_plot_aspect_height([id]) get_plot_aspect_ratio([id]) get_plot_aspect_width([id])
Description
The function arguments.
Argument | Description |
---|---|
id | A ChipsId structure identifying the item. |
ratio | The new aspect ratio for the plot, as a string. The format should be "a:b" - where a and b are numbers - or "current", "fit", or the empty string "". |
The set_plot_aspect_ratio command is used to change the aspect ratio of the plot.
The get_plot_aspect commands return the height, width, and aspect ratio of the specified plot.
"ratio" option values
Value | Description |
---|---|
"a:b" | Explicitly set the aspect ratio, e.g. "2:1". |
"current" | Set the aspect ratio to the ratio of the margins currently defining the plot area. |
"fit" | Match the aspect ratio to the data ranges. This is not based on the limits the axes are currently displaying; it uses the full data range without any padding. |
"" | Turn off the aspect ratio. Using this option expands the aspect ratio back to the area defined by the plot margins. |
For more information on aspect ratios, refer to "ahelp aspectratio".
Examples
Example 1
chips> add_plot() chips> set_plot_aspect_ratio("1:2") chips> print(get_plot_aspect_height()) 2.0 chips> print(get_plot_aspect_width()) 1.0 chips> print(get_plot_aspect_ratio()) 1:2
Create an blank plot area. Change the aspect ratio, then confirm the new ratio.
Example 2
chips> add_curve("rprofile.fits[cols r,bright]") chips> set_plot_aspect_ratio("fit") chips> print(get_plot_aspect_ratio()) 185.0:3.9
Plot a radial profile, then set the aspect ratio of the plot to the data ranges. Finally, get the new plot aspect ratio.
Bugs
See the bugs pages on the ChIPS website for an up-to-date listing of known bugs.
See Also
- limits
- get_plot_range
- plots
- add_plot, adjust_grid_gaps, adjust_grid_xrelsize, adjust_grid_xrelsizes, adjust_grid_yrelsize, adjust_grid_yrelsizes, clear_plot, current_plot, delete_plot, display_plot, get_plot, grid_objects, hide_plot, move_plot, reposition_plot, set_data_aspect_ratio, set_plot, split, strip_chart, swap_object_positions