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

URL: http://cxc.harvard.edu/chips/ahelp/set_plot.html
AHELP for CIAO 4.9 ChIPS v1

set_plot

Context: plots

Synopsis

Modifies the attributes of an existing plot.

Syntax

set_plot(attributes)
set_plot(id, attributes)

Description

The function arguments.

Argument Description
id A ChipsId structure identifying the item, or a string containing the name of the object.
attributes Configure object properties by giving an attribute string (a space-separated list of key=value pairs), list, dictionary, or a ChIPS object.

The set_plot command sets the specified attributes to the provided values. The modified plot becomes current. Multiple plots may be modified with a single command by setting the currency to "all".

Customizing the Plot

There are several attributes that control the characteristics of plots. The set_plot command may be used to modify the attribute values of an existing plot at any time during a ChIPS session. See "ahelp attributes" and "ahelp setget" for more general information.

If multiple attributes are being set simultaneously and one of them fails, the entire command will fail and the plot will not be modified.

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

Plot Titles and Axis Labels

The plot title and axis labels are not controlled by an attribute of the set_plot command. They are specified with the set_plot_title, set_plot_xlabel, and set_plot_ylabel commands:

chips> set_plot_title("Figure 1")
chips> set_plot_xlabel("TIME (s)")
chips> set_plot_ylabel("COUNT\_RATE (count/s)")

The value is an alphanumeric string; Latex formatting is allowed. There are many attributes to customize the title via the set_plot command: position, depth, horizontal and vertical alignment, angle, color, size, font and fontstyle.

To customize the appearance of X and Y labels (color, font, size, and alignment), the set_axis command is used: "ahelp set_axis" .

Advanced Functions

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

set_plot_aspect_ratio
set_plot_axisstyle
set_plot_bottommargin
set_plot_cornerstyle
set_plot_leftmargin
set_plot_rightmargin
set_plot_title_angle
set_plot_title_color
set_plot_title_depth
set_plot_title_font
set_plot_title_fontstyle
set_plot_title_halign
set_plot_title_size
set_plot_title_valign
set_plot_title_xpos
set_plot_title_ypos
set_plot_topmargin

Example 1

chips> set_plot(["style", "box"])

Using attribute/value pairs, set the plot style to box.

Example 2

chips> set_plot({"style": "box"})

This is a repeat of the previous example, using a dictionary rather than a list to define the attributes to change.

Example 3

chips> plt = ChipsPlot()
chips> plt.style = "box"
chips> plt.corner.style = "bevel"
chips> set_plot("plot1", plt)

Populate the "plt" structure with attribute values, then use it to set plot1 to have a box border style with beveled corners.

Attribute settings

The plot.style attribute

Value Description
open A plot with no borders.
box A plot with four solid lines as borders (with no tick marks).
closed All four borders have major and minor tick marks that are synchronized with the corresponding axes.

The plot.corner.style attribute

Value Description
miter The end of the axes meet at an angle to form the corner. The slope where the two faces join depends upon the thickness of the two lines
bevel Connect the outside corners of the two lines; miter the inside faces to the bevel.
fill Outside corner with one line drawn over the other.
notch Leave the corners open.

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

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