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

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


AHELP for CIAO 4.5 ChIPS v1

adjust_grid_gaps

Context: plots

Synopsis

Modifies the spacing between plots created by split or grid_objects.

Syntax

adjust_grid_gaps([id,] xgap, ygap)

Description

  • id - an optional ChipsId structure containing values to modify the currency state for the command
  • xgap - spacing between the columns of plots as percentage of the frame width
  • ygap - spacing between the rows of plots as percentage of the frame width

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

There are also individual commands for modifying just the xgap or the ygap:

adjust_grid_xgap([id,] xgap)
adjust_grid_ygap([id,] 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(.15,.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,.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(.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 2012
CXC logo

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-2012. All rights reserved.