About Chandra Archive Proposer Instruments & Calibration Newsletters Data Analysis HelpDesk Calibration Database NASA Archives & Centers Chandra Science Links

Skip the navigation links
Last modified: December 2008

URL: http://cxc.harvard.edu/chips4.1/get_histogram.sl.html
AHELP for ChIPS 4.1

get_histogram

Context: sl.chips

Synopsis

Retrieves the attribute value(s) of the histogram.

Syntax

get_histogram();
get_histogram(id [,attribute]);

Description

  • id - an optional ChipsId structure containing values to modify the currency state for the command or a string id to specify a histogram within the current plot.
  • attribute - a string containing the name of the attribute to retrieve

The get_histogram command returns a structure containing all the attribute values of the histogram. 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.

The attributes associated with histograms are:

Attribute Description
depth Integer value indicating line depth
dropline Boolean indicating whether vertical lines delineating each histogram bin should be drawn
err.color Color of the histogram err bars
err.down Plot y down errors if data provided
err.style Specifies the error bar style
err.thickness Specifies the thickness of error bars
err.up Plot y up errors if data provided
fill.color Color of the histogram fill, if visible
fill.opacity Opacity of the histogram fill, if visible
fill.style the fill style for the histogram
line.color Color of the histogram line
line.style the pattern used for the histogram line style
line.thickness Thickness of the histogram line
symbol.angle The angle of rotation for the histogram symbols
symbol.color Color of the histogram symbols
symbol.fill Should the histogram symbols be filled or not
symbol.size Size of the histogram symbols
symbol.style The shape of the glyph used as the histogram symbols

Data Range

The get_histogram_range command returns the X and Y ranges of the current axes of the current plot. The values are returned as [xmin, xmax, ymin, ymax]. There are also individual commands for retrieving just the x or y range: get_histogram_xrange and get_histogram_yrange.

To see if a histogram is hidden or visible, use the get_histogram_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_histogram_depth
get_histogram_dropline
get_histogram_errcolor
get_histogram_errdown
get_histogram_errstyle
get_histogram_errthickness
get_histogram_errup
get_histogram_fill
get_histogram_fillcolor
get_histogram_fillopacity
get_histogram_linecolor
get_histogram_linestyle
get_histogram_linethickness
get_histogram_symbolangle
get_histogram_symbolcolor
get_histogram_symbolfill
get_histogram_symbolsize
get_histogram_symbolstyle

Example 1

chips> add_histogram("peak.fits[cols energy,counts]");
chips> print(get_histogram());
chips> print(get_histogram("hist1","fill.color"));

A histogram is created and becomes current. Calling get_histogram with no argument returns all the attributes of the object. get_histogram is called a second time to return just the "fill.color" attribute.

Example 2

chips> add_histogram("peak.fits[cols energy,counts]");
chips> add_histogram([10,12,15]);
chips> print(get_histogram("hist1"));

Two histograms are created. get_histogram is called with the id of the first histogram, returning all attributes.

Example 3

chips> id=ChipsId();
chips> id.histogram="hist1";
chips> print(get_histogram(id));

A ChipsId structure is created and the id.histogram field is set to "hist1". get_histogram is called with the ChipsId.

Example 4

chips> histatt=get_histogram;
chips> print(histatt);

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

CHANGES IN CIAO 4.1

The attribute "fill.style" replaces the "fill.visible" attribute. There are multiple fill styles available, instead of a boolean filled/not filled. A value of 0 (chips_nofill) is equivalent to fill.visible=0; a value of 1 (chips_solidfill) is equivalent to fill.visible=1 .

Bugs

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

Last modified: December 2008



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