Chandra X-Ray Observatory
Skip to the navigation links
Last modified: December 2013

Jump to: Description · Examples · Bugs · See Also

AHELP for CIAO 4.9 ChIPS v1


Context: plots


Set or retrieve the aspect ratio information of the plot.


set_plot_aspect_ratio([id], ratio)


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".

Example 1

chips> add_plot()
chips> set_plot_aspect_ratio("1:2")
chips> print(get_plot_aspect_height())
chips> print(get_plot_aspect_width())
chips> print(get_plot_aspect_ratio())

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())

Plot a radial profile, then set the aspect ratio of the plot to the data ranges. Finally, get the new plot aspect ratio.


See the bugs pages on the ChIPS website for an up-to-date listing of known bugs.

See Also

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

Last modified: December 2013
Smithsonian Institute Smithsonian Institute

The Chandra X-Ray Center (CXC) is operated for NASA by the Smithsonian Astrophysical Observatory. 60 Garden Street, Cambridge, MA 02138 USA.   Email: Smithsonian Institution, Copyright © 1998-2017. All rights reserved.