Last modified: December 2013

URL: https://cxc.cfa.harvard.edu/chips/ahelp/get_plot.html
AHELP for CIAO 4.11 ChIPS v1

get_plot

Context: plots

Synopsis

Retrieves the attribute value(s) of the plot.

Syntax

get_plot()
get_plot(id)
get_plot(id, attribute)

Description

The function arguments.

Argument Description
id A ChipsId structure identifying the item, or a string containing the name of the object.
attribute The name of the attribute to retrieve, such as 'leftmargin' or 'style'.

The get_plot command returns a structure containing all the attribute values of the plot. To retrieve the value of a specific attribute, provide the attribute name and the id or ChipsId of the object.

Some values are set to "None" in the returned structure. These entries generally correspond to attributes which may only be modified at creation time, such as the object id.

Please see the section "Plot Preferences and Attributes" below the examples for a list of the plot attributes.

Note that the plot title is not included in the attributes. In order to get that value, use the get_plot_title command.

To see if a plot is hidden or visible, use the get_plot_visible command.

Advanced Functions

The module of advanced ChIPS functions contains other commands for retrieving attribute values (refer to "ahelp chips" for information on loading the module):

get_plot_aspect_height
get_plot_aspect_ratio
get_plot_aspect_width
get_plot_axisstyle
get_plot_bottommargin
get_plot_cornerstyle
get_plot_leftmargin
get_plot_rightmargin
get_plot_title_angle
get_plot_title_color
get_plot_title_depth
get_plot_title_font
get_plot_title_fontstyle
get_plot_title_halign
get_plot_title_size
get_plot_title_valign
get_plot_title_xpos
get_plot_title_ypos
get_plot_topmargin

Examples

Example 1

chips> add_plot()
chips> print(get_plot())
chips> print(get_plot("plot1", "leftmargin"))

A plot is created and becomes current. Calling get_plot with no argument returns all the attributes of the object. get_plot is called a second time to return just the "leftmargin" attribute.

Example 2

chips> add_plot()
chips> add_plot(0.2, 0.2, 0.7, 0.7)
chips> print(get_plot("plot1"))

Two plots are created. get_plot is called with the id of the first plot, returning all attributes.

Example 3

chips> id = ChipsId()
chips> id.plot = "plot1"
chips> print(get_plot(id))

A ChipsId structure is created and the id.plot field is set to "plot1". get_plot is called with the ChipsId.

Example 4

chips> plotatt = get_plot()
chips> print(plotatt)

Retrieve a structure containing the attribute values of the current plot and store the results in "plotatt". Print the contents of "plotatt".


Plot Preferences and Attributes

The attributes associated with plots are given in the following table, where the "Set?" column refers to whether the attribute can be changed using the set_plot() command. To change the plot preference settings prepend "plot." to the attribute name.

Attribute Description Options Default Set?
bottommargin The distance, in Frame Normalized coordinates, between the bottom plot border and the bottom border of the frame containing the plot Real values ranging from zero through one 0.15 Yes
corner.style border corner style miter|bevel|fill|notch; see "ahelp set_plot" for descriptions miter Yes
leftmargin The distance, in Frame Normalized coordinates, between the left plot border and the left border of the frame containing the plot Zero through one 0.15 Yes
rightmargin The distance, in Frame Normalized coordinates, between the right plot border and the right border of the frame containing the plot Real values ranging from zero through one 0.10 Yes
stem stem used for plot id An alpha-numeric character sequence that does not contain a space plt No
style border style open|box|closed; see "ahelp add_plot" for descriptions closed Yes
title.angle Angle, in degrees, at which the plot title is drawn -360.0 to 360.0 0.0 Yes
title.color Color of the plot title text string name or hex; see the Color section of "ahelp chipsopt" default Yes
title.depth Integer value indicating the depth of the plot title see the Depth section of "ahelp chipsopt" default Yes
title.font Plot title font helvetica|courier|times|greek; see the Font section of "ahelp chipsopt" helvetica Yes
title.fontstyle Specific attributes of the text string independent of size or font normal|bold|italic|bolditalic; see the Font Style section of "ahelp chipsopt" normal Yes
title.halign Horizontal location of the string reference point of the plot title auto|base|center|left|right|top; see the Text Alignment section of "ahelp chipsopt" center Yes
title.size Font size of the plot title 1 to 100 16 Yes
title.valign Vertical location of the string reference point of the plot title auto|base|center|left|right|top; see the Text Alignment section of "ahelp chipsopt" auto Yes
title.xpos X position, in Plot Normalized coordinates, of the reference point of the plot title Real values ranging from zero through one 0.5 Yes
title.ypos Y position, in Plot Normalized coordinates, of the reference point of the plot title Real values. 1.05 Yes
topmargin The distance, in Frame Normalized coordinates, between the upper plot border and the upper border of the frame containing the plot Real values ranging from zero through one 0.10 Yes
aspect.ratio The default aspect ratio of the plot, where "" means no aspect ratio is set. See "ahelp aspectratio" for the meaning and syntax of this value. Yes

Bugs

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

See Also

concepts
setget
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, grid_objects, hide_plot, move_plot, reposition_plot, set_data_aspect_ratio, set_plot, set_plot_aspect_ratio, split, strip_chart, swap_object_positions
utilities
set_current