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

URL: http://cxc.harvard.edu/chips/ahelp/adjust_grid_gaps.html
Jump to: Description · Examples · Bugs · See Also


AHELP for CIAO 4.6 ChIPS v1

adjust_grid_gaps

Context: plots

Synopsis

Modifies the spacing between plots created by split or grid_objects.

Syntax

adjust_grid_gaps(xgap, ygap)
adjust_grid_gaps(id, xgap, ygap)

adjust_grid_xgap(xgap)
adjust_grid_xgap(id, xgap)

adjust_grid_ygap(ygap)
adjust_grid_ygap(id, ygap)

Description

The function arguments.

Argument Description
xgap, ygap The horizontal and vertical spacing between the plots as a fraction of the default plot width and height, respectively.
id A ChipsId structure identifying the item.

The adjust_grid_gaps command adjusts the space between the plot areas in a gridded plot created by the split or grid_objects command.

There are also individual commands for modifying just the xgap or the ygap: adjust_grid_xgap and adjust_grid_ygap.

The values of xgap and ygap must be greater than or equal to 0, but less than 1. The number of rows or columns in the grid/split and the size of the plot margins impact the maximum value of either parameter. The plot sizes are adjusted to accommodate the new spacing. The size of the plots in the grid are calculated as follows:

plot_width = (1 - (left_margin+right_margin + (ncols-1)*xgap))/ncols

plot_height = (1 - (bottom_margin+top_margin + (nrows-1)*ygap))/nrows

The margins, gaps, and plot widths in each direction (horizontal and vertical) must sum to 1.

To change the relative sizes of the plots, refer to the help file for each of the following commands: adjust_grid_xrelsize, adjust_grid_xrelsizes, adjust_grid_yrelsize, or adjust_grid_yrelsizes.

Example 1

chips> split(2, 2)
chips> adjust_grid_gaps(0.15, 0.1)

A split command is issued to create a grid of four plots with no gap between them. The adjust_grid_gaps command changes the vertical spacing between the rows to 10 percent and the horizontal spacing between the columns to 15 percent.

Example 2

chips> grid_objects(3, 2, 0.05, 0.05, 1)
chips> adjust_grid_gaps(0.04, 0.1)

A grid_objects command is called to create a grid of 6 plot areas; the spacing between rows and columns is five percent of the frame width (0.05). The adjust_grid_gaps command changes the column spacing to 4 percent and the row spacing to 10 percent.

Example 3

chips> grid_objects(3, 3, 0, 0, 1)
chips> adjust_grid_ygap(0.05)

A grid_objects command is called to create a grid of 9 plot areas with no gap. The adjust_grid_ygap command sets the vertical spacing to five percent (0.05).

Example 4

chips> split(2, 2)
chips> adjust_grid_xgap(0.1)

A split command creates a grid of four plots with no gap. The adjust_grid_xgap command changes the horizontal spacing between the columns to 10 percent.

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_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, set_plot_aspect_ratio, 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:   cxcweb@head.cfa.harvard.edu Smithsonian Institution, Copyright © 1998-2014. All rights reserved.