|
|
|
|
Concepts: ValuesThis document describes how attribute values - such as the line style, symbol color, and ticklabel formats - are specified. The Attributes concept documentation describes how you change the attributes of an object.
BooleansNumerous object attributes are represented as boolean states, such as object visibility and fill properties. Behaviors like auto limit calculations are also boolean. Depending on the context, a boolean value may be specifed as an integer or a string value. For example, when using an attribute string, the string values are used ("fill=true"), but when using an attribute list to set values either a numeric or a string may be used ({"fill",1} or {"fill","true"}). For integer representations, a 0 equates to false while a 1 equates to true. For string representations, a wide range of values may be used to specify the boolean settings. The predefined Python True and False boolean values are also supported.
ColorColor is an attribute of nearly all objects in ChIPS, and there is a vast palette available. The colors documentation describes how to specify color values and how to set the color attributes of objects. Since the colors used for video displays are often not optimal for hardcopies, ChIPS provides a special color identifier "default". Any item set to "default" will use user-configurable default colors for foreground and background colors in terminals as well as hardcopies. Colors may be specified by name ( "lime", "gray", "black") or as hex values (RRGGBB where 0xff0000 = Red, 0x00ff00 = Green, 0x0000ff = Blue).
Contour ModeThe contour mode sets how levels are determined in contours. The following contour modes are supported:
DepthDepth control allows the user to specify the depth at which each object is placed within a frame. When objects are created, they are assigned a depth value. The depth to which an object is assigned, along with the order that the objects were added to the depth, determines the rendering order of the frame. Depths are rendered from the lowest depth value greater than 0 to the highest depth value in use. Objects at higher depths may overlap lower objects. Depths are specified as positive integers where the value 1 represents the lowest items ("farther" from the top). The depth value 0 ("default", V_USE_DEFAULT_DEPTH) represents a special case. If the value is default, then default frame depth is used. The value of the frame default is initialized to the value of the preference "default.depth", but may be modified by using the set_default_depth command. The new setting does not affect the depth of existing objects, only new ones created after the call to set_default_depth. Fill Patterns
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Name | Enumeration | Numeric | Description |
| nofill or none | chips_nofill | 0 | no fill |
| solidfill or solid | chips_solidfill | 1 | solid fill |
| updiagonal | chips_updiagonal | 2 | diagonal lines from lower left to upper right |
| downdiagonal | chips_downdiagonal | 3 | diagonal lines from upper left to lower right |
| horizontal | chips_horizontal | 4 | horizontal stripes |
| vertical | chips_vertical | 5 | vertical stripes |
| crisscross | chips_crisscross | 6 | diagonal grid (diamonds) |
| brick | chips_brick | 7 | brick wall pattern |
| grid | chips_grid | 8 | square grid |
| hexagon | chips_hexagon | 9 | hexagon tesselation |
| polkadot | chips_polkadot | 10 | tiny pluses |
| zigzag | chips_zigzag | 11 | vertical wave pattern |
| wave | chips_wave | 12 | horizontal wave pattern |
| flower | chips_flower | 13 | flower petal pattern |
| userfill1 | chips_userfill1 | 14 | user-loadable pattern; preloaded with pig face |
| userfill2 | chips_userfill2 | 15 | user-loadable pattern; preloaded with links |
| userfill3 | chips_userfill3 | 16 | user-loadable pattern; preloaded with cross/eight-point star |
Export attributes are used to control the output files generated by ChIPS. Users may specify various file formats. In addition, color format, scaling, margins, and other attributes of the output may be specified.
Attributes that are specific to page layouts (margins, page size, orientation, etc.) only apply to pdf and ps formats.
| Name | Description | Options | Default |
| clobber | overwrite the output file if it exists | boolean value | false |
| colorscheme | how to handle colors in output | rgb|cmyk|cmyksep|grayscale | rgb |
| fonts | embed the font in the postscript file | boolean | true |
| format | output file format | ps|eps|pdf|png|jpg | ps |
| orientation | how to orient the output | portrait|landscape | portrait |
| leftmargin | left page margin | number of pageunits | 0 |
| rightmargin | right page margin | number of pageunits | 0 |
| bottommargin | bottom page margin | number of pageunits | 0 |
| topmargin | top page margin | number of pageunits | 0 |
| pagewidth | width of the page | number of pageunits | 8.5 |
| pageheight | height of the page | number of pageunits | 11 |
| pagesize | standard predefined page dimensions | letter|legal|executive|A3|A4|A5 | letter |
| pageunits | units of page attributes (margins, height, etc...) | mm|cm|inch|pixels | inch |
| scaleheight | scale the height of the window | 0 | |
| scalewidth | scale the width of the window | 0 | |
| keepaspect | keep the aspect ratio of the original window | boolean | true |
| fittopage | adjust contents to fit to page | boolean | false |
ChIPS provides four installed fonts: times, helvetica, courier, and greek.
| Name | Enumeration | Numeric | Description |
| helvetica | chips_helvetica | 0 | san serif font |
| courier | chips_courier | 1 | slab serif font |
| times | chips_times | 2 | transitional/baroque serif font |
| greek | chips_greek | 3 | greek symbol font |
In addition to the standard fonts, ChIPS provides limited support for users to load their own fonts. The user-loaded fonts work on the screen displays and output png and jpg formats, but do not work in ps, eps, or pdf output formats. Furthermore, the user-loaded fonts do not get saved in state files.
# Python
load_font("bookman","/my_fonts/bookman.pfb", chips_normal)
load_font("bookman","/my_fonts/bookman_b.pfb", chips_bold)
load_font("bookman","/my_fonts/bookman_i.pfb", chips_italic)
load_font("bookman","/my_fonts/bookman_bi.pfb", chips_bolditalic)
add_label(.1,.5,"AbCdEfGhIjKlM","font=bookman fontstyle=bold")
% S-Lang
load_font("bookman","/my_fonts/bookman.pfb", chips_normal);
load_font("bookman","/my_fonts/bookman_b.pfb", chips_bold);
load_font("bookman","/my_fonts/bookman_i.pfb", chips_italic);
load_font("bookman","/my_fonts/bookman_bi.pfb", chips_bolditalic);
add_label(.1,.5,"AbCdEfGhIjKlM","font=bookman fontstyle=bold");
Font styles allow the user to add emphasis to labels by changing their appearance. Font styles for user-loaded fonts are dependent on whether the appropriate files have been provided.
The pre-installed Greek font only supports normal font style.
| Name | Enumeration | Numeric | Description |
| normal | chips_normal | 0 | standard display of text |
| bold | chips_bold | 1 | stronger or thicker display of text |
| italic | chips_italic | 2 | slanted display of text |
| bolditalic | chips_bolditalic | 3 | stronger or thicker display of slanted text |
Line styles refer to the stipple pattern used to draw lines and edges for objects such as lines, curves, regions, and grids.
The following line styles are supported:
| Name | Enumeration | Numeric | Description |
| noline | chips_noline | 0 | no line rendered |
| solid | chips_solid | 1 | solid line |
| dot | chips_dot | 2 | dotted line |
| dotlongdash | chips_dotlongdash | 3 | repeating dot longdash sequences |
| dotshortdash | chips_dotshortdash | 4 | repeating dot shortdash sequences |
| longdash | chips_longdash | 5 | line comprised of long dashes |
| shortdash | chips_shortdash | 6 | line comprised of short dashes |
| shortdashlongdash | chips_shortdashlongdash | 7 | alternating short and long dashes |
ChIPS utilizes various objects to create figures. Ii is necessary to specify the object to which an action should be applied when using any of the non-object-specific commands, e.g. move, shuffle, set_attribute.
Object type are represented as an enumeration in ChIPS. It is possible to specify an object type using either the enumeration (chips_line) or its numeric value (11 for chips_line).
| Name | Enumeration | Numeric | Description |
| window | chips_window | 2 | a window object |
| frame | chips_frame | 3 | a frame object |
| plot | chips_plot | 5 | a plot area object |
| curve | chips_curve | 6 | a curve or trace within a plot |
| histogram | chips_histogram | 7 | a histogram trace within a plot |
| contour | chips_contour | 8 | a contour object within a plot |
| axis | chips_axis | 9 | an axis object within a plot |
| label | chips_label | 10 | a label object |
| line | chips_line | 11 | a line or polyline object |
| point | chips_point | 13 | a point object |
| region | chips_region | 14 | a region or polygon object |
Symbol styles refer to the glyphs used to represent points, curve data points, and histogram data points.
The following symbol styles are supported:
| Name | Enumeration | Numeric | Description |
| none | chips_none | 0 | no symbol is rendered |
| cross | chips_cross | 1 | a symmetrical x symbol |
| diamond | chips_diamond | 2 | a diamond shaped symbol |
| downtriangle | chips_downtriangle | 3 | equilateral triangle with vertex pointing down |
| circle | chips_circle | 4 | a circle symbol |
| plus | chips_plus | 5 | a symmetrical + symbol |
| square | chips_square | 6 | a box shaped symbol |
| uptriangle | chips_uptriangle | 7 | equilateral triangle with vertex pointing up |
| point | chips_dot | 8 | a dot symbol |
| arrow | chips_arrow | 9 | an arrow symbol (angle property controls direction) |
Text alignment determines how a label is displayed in relation to the associated location. It is sometimes referred to as text justification. For instance, text that is left-justified has its leftmost edge placed at the specified location or reference point. Right-justified means the text is placed so that the rightmost portion of the label ends at the specified location.
For vertical alignment the baseline of the text (neglecting descenders such as "p", "g", or "q") is the 0 or base. The top is determined by the height of standard glyphs in the label.
Text Alignments may be specified as numeric values or as the predefined values specified in the table below. Numeric values greater than 1 or less than 0 result in the labels shifting over by a ratio based on the height or width of the text. For instance, a horizontal alignment of -1 will place the label to the right of anchor position, by the length of the label.
| Value | Numeric | Horizontal Use | Vertical Use |
| auto | -99.0 | determines the appropriate reference position based on the type and position of object | determines the appropriate reference position based on the type and position of object |
| base | 0.0 | N/A | places the reference position at the text baseline |
| center | 0.5 | places the reference position in the center of the text. | places the reference position in the center of the text. |
| left | 0.0 | places the reference position at the start of the text string | N/A |
| right | 1.0 | places the reference position at the end of the text string | N/A |
| top | 1.0 | N/A | places the reference position at the top of the text |
ChIPS labels support a number of simple latex formatting sequences including subscripts, superscripts, fonts, font styles, colors, and special symbols.
A number of symbols have been added to CIAO 4.1, such as
\sun (also known as \odot),
\circ, and the planets (e.g.
\mercury), and other symbols.
They are marked with a new label in the
"Supported LaTeX Symbols" table below.
Since both Python and S-Lang interpret \ as a control character, it should either be preceeded by another backslash, as in the examples below, or the text can be labelled as containing \ symbols by saying:
# Python r"y = \alpha^2_i"
% S-Lang "y = \alpha^2_i"R
Some examples of the LaTeX support in ChIPS:
The following formatting sequences are supported:
| Feature | Description | Example |
| Bold | Make a portion of the text bold regardless of the fontstyle | "\\textbf{Ch}allange" |
| Color | Set the color of a portion of the text regardless of the color | "a {\\color{skyblue} blue} fish" |
| Italic | Make a portion of the text italic regardless of the fontstyle | "the \\textit{right} one" |
| Medium | Make a portion of the text medium regardless of the fontstyle | "a \\textmd{plain} one" |
| Roman | Make a portion of the text roman (times) regardless of the font | "see \\textrm{spot} run"" |
| San Serif | Make a portion of the text san serif (helvetica) regardless of the font | "see \\textsf{spot} run"" |
| Subscript | place a single character subscript | "A_2" |
| Subscript | place a string subscript | "A_{floor}" |
| Superscript | place a single character superscript | "X^Y" |
| Superscript | place a string superscript | "r^{x+1}" |
| Symbol | use special characters or symbols | see following table |
| Typewriter | Make a portion of the text typewriter (courier) regardless of the font | "see \\texttt{spot} run" |
| Supported Latex Symbols | |
|---|---|
| Symbol | Description |
| \AA | Angstrom symbol |
| \alpha | lowercase greek alpha character |
| \Alpha | uppercase greek alpha character |
| \beta | lowercase greek beta character |
| \Beta | uppercase greek beta character |
| \gamma | lowercase greek gamma character |
| \Gamma | uppercase greek gamma character |
| \delta | lowercase greek delta character |
| \Delta | uppercase greek delta character |
| \epsilon | lowercase greek epsilon character |
| \Epsilon | uppercase greek epsilon character |
| \zeta | lowercase greek zeta character |
| \Zeta | uppercase greek zeta character |
| \eta | lowercase greek eta character |
| \Eta | uppercase greek eta character |
| \theta | lowercase greek theta character |
| \Theta | uppercase greek theta character |
| \iota | lowercase greek iota character |
| \Iota | uppercase greek iota character |
| \kappa | lowercase greek kappa character |
| \Kappa | uppercase greek kappa character |
| \lambda | lowercase greek lambda character |
| \Lambda | uppercase greek lambda character |
| \mu | lowercase greek mu character |
| \Mu | uppercase greek mu character |
| \nu | lowercase greek nu character |
| \Nu | uppercase greek nu character |
| \xi | lowercase greek xi character |
| \Xi | uppercase greek xi character |
| \omicron | lowercase greek omicron character |
| \Omicron | uppercase greek omicron character |
| \pi | lowercase greek pi character |
| \Pi | uppercase greek pi character |
| \rho | lowercase greek rho character |
| \Rho | uppercase greek rho character |
| \sigma | lowercase greek sigma character |
| \Sigma | uppercase greek sigma character |
| \tau | lowercase greek tau character |
| \Tau | uppercase greek tau character |
| \upsilon | lowercase greek upsilon character |
| \Upsilon | uppercase greek upsilon character |
| \phi | lowercase greek phi character |
| \Phi | uppercase greek phi character |
| \chi | lowercase greek chi character |
| \Chi | uppercase greek chi character |
| \psi | lowercase greek psi character |
| \Psi | uppercase greek psi character |
| \omega | lowercase greek omega character |
| \Omega | uppercase greek omega character |
| \odot | Sun
|
| \sun | Sun
|
| \mercury | Mercury
|
| \venus | Venus
|
| \earth | Earth
|
| \mars | Mars
|
| \jupiter | Jupiter
|
| \saturn | Saturn
|
| \uranus | Uranus
|
| \neptune | Neptune
|
| \pluto | Pluto
|
| \circ | circ
|
| \textdegree | degree
|
| \int | integral
|
| \pentagon | pentagon
|
| \hexagon | hexagon
|
| \ScissorRight | scissors
|
| \Asterisk | asterisk
|
| \FiveStar | five-point star
|
| \SixStar | six-point star
|
| \leftmoon | left moon
|
| \rightmoon | right moon
|
| \maltese | maltese cross
|
| \rightturn | circular arrow
|
| \smiley | happy face
|
| \eighthnote | eighth note
|
| \hbar | hbar
|
| \pounds | pounds symbol |
| \pm | plus or minus symbol |
| \div | division symbol |
| \times | multiplication symbol |
| \copyright | copyright symbol |
| \aa | lowercase a with circle above it |
| \ae | lowercase ae symbol |
| \AE | uppercase AE symbol |
| \clubsuit | club symbol |
| \heartsuit | heart symbol |
| \spadesuit | spade symbol |
| \diamondsuit | diamond symbol |
| \forall | for all symbol (inverted capital A) |
| \exists | exists symbol (backwards capital E) |
| \angle | angle symbol |
| \neq | not equal |
| \equiv | equivalent |
| \approx | approximate |
| \bullet | bullet |
| \infty | infinity |
| \otimes | circle containing x |
| \oplus | circle containing plus |
| \leftrightarrow | narrow shaft arrow pointing left and right |
| \leftarrow | narrow shaft arrow pointing left |
| \rightarrow | narrow shaft arrow pointing right |
| \uparrow | narrow shaft arrow pointing up |
| \downarrow | narrow shaft arrow pointing down |
| \Leftrightarrow | wide shaft arrow pointing left and right |
| \Leftarrow | wide shaft arrow pointing left |
| \Rightarrow | wide shaft arrow pointing right |
| \Uparrow | wide shaft arrow pointing up |
| \Downarrow | wide shaft arrow pointing down |
| \aleph | aleph |
| \in | in |
| \notin | not in |
| \cap | cap |
| \cup | cup |
| \supset | superset |
| \supseteq | superset eq |
| \subset | subset |
| \subseteq | subset eq |
| \leq | less than or equal |
| \geq | greater than or equal |
| \propto | propto |
| \partial | partial |
| \Im | Im |
| \Re | Re |
| \wp | wp |
| \ldots | ellipsis |
| \cong | congruent |
| \diamond | diamond |
| \langle | langle |
| \lceil | lceil |
| \nabla | nabla |
| \surd | surd |
| \neg | neg |
Thickness is a property of objects which display line segments, such as curves, contours, and regions.
Thickness is specified as a floating point value which may range from 0.5 to 10.0. Screen displays typically represent line thickness as integer values, but floating point specifications are supported for postscript output. While a value of 0.5 and 1 will appear differently in postscript output, they will both appear as a thickness of 1 in the screen display.
Tick formats allow the user to specify the appearance of axis tick labels. The syntax is similar to that of the C printf format strings: "%<qualifier><format>". Text may be included before or after the qualifier.
# Python
set_axis("ay1",["tickformat","distance %2.1f km"])
% S-Lang
set_axis("ay1",{"tickformat","distance %2.1f km"});
Tick formats do not support latex conventions.
The following tick formats are supported:
| Format | Description | Example 1 | Example 2 |
| %d | integer values. Use a format qualifier such as .4d to 0 pad entries (0=0000, 150=0150) | 0 | 1000000 |
| %dec | sexigesimal dec (degrees, minutes, seconds).Use a format qualifier such as %3.2dec to specify the precision of seconds | 00^o00'00" | 06^o30'15" |
| %dec1 | sexigesimal dec- degrees, minutes, seconds ##:##:##.Use a format qualifier such as %3.2dec1 to specify the precision of seconds | -25:00:00 | +50:30:15 |
| %dec2 | sexigesimal dec- degrees, minutes, seconds ## ## ##.Use a format qualifier such as %3.2dec2 to specify the precision of seconds | -25 00 00 | +50 30 15 |
| %dec3 | sexigesimal dec- degrees, minutes, seconds ##d ##m ##s.Use a format qualifier such as %3.2dec3 to specify the precision of seconds | -25d 00m 00s | +50d 30m 15s |
| %DEC3 | sexigesimal dec- degrees, minutes, seconds ##D ##M ##S.Use a format qualifier such as %3.2DEC3 to specify the precision of seconds | -25D 00M 00S | +50D 30M 15S |
| %f | use floating point representation | 0.000000 | 1000000.000000 |
| %g | use most compact output of data | 0 | 1e+06 |
| %ra | sexigesimal ra - hours, minutes, seconds. Use a format qualifier such as %3.2ra to specify the precision of seconds | 00^h00^m00^s | 06^h30^m15^s |
| %ra1 | sexigesimal ra - hours minutes seconds (##:##:##). Use a format qualifier such as %3.2ra1 to specify the precision of seconds | 00:00:00 | 06:30:15 |
| %ra2 | sexigesimal ra- hours minutes seconds (## ## ##). Use a format qualifier such as %3.2ra2 to specify the precision of seconds | 00 00 00 | 06 30 15 |
| %ra3 | sexigesimal ra (##h ##m ##s). Use a format qualifier such as %3.2ra3 to specify the precision of seconds | 00h 00m 00s | 06h 30m 15s |
| %RA3 | sexigesimal ra (##H ##M ##S). Use a format qualifier such as %3.2RA3 to specify the precision of seconds | 00H 00M 00S | 06H 30M 15S |
| %ra4 | sexigesimal ra - hours, minutes, seconds. Use a format qualifier such as %3.2ra4 to specify the precision of seconds | 00^h00^m00^s | 06^h30^m15^s |
| %RA4 | sexigesimal ra - hours, minutes, seconds. Use a format qualifier such as %3.2RA4 to specify the precision of seconds | 00^H00^M00^S | 06^H30^M15^S |
| %z | value x 10 to the n | 0.000000 x 10^0 | 1.000000 x 10^6 |
| %Z | value x 10 to the n for n over precision | 0 | 1 x 10^6 |
Tick modes control the placement of tick marks on an axis. There are different modes which may be utilized. Two of the modes automatically determine tick locations based on the values of the data being plotted. The other three use data-independent values.
Changing the values associated with interval, count, or arbitrary tick marks (majortick.interval, majortick.count, and arbitrary tick positions respectively) will result in the axis automatically changing to the appropriate tick mode.
Changing the tick mode may result in a change in the range of one or more axes.
The following tick modes are supported; details on each follow the table.
| Name | Enumeration | Description |
| arbitrary | chips_arbitrary | places tick marks at user specified locations |
| count | chips_count | attempts to display the user specified number of tick marks |
| interval | chips_interval | spaces tick marks at the user specified interval |
| limits | chips_limits | calculate tick marks to be spaced on "nice" intervals (factors of 1,2,5,10) and pad axes ends; recommended for use with log axes |
| nice | chips_nice | calculate tick marks to be spaced on "nice" intervals (factors of 1,2,5,10) ending on major ticks; recommended for use with log axes |
Tick styles specify how the tick marks are placed on an axis. They may centered on the axis such that they extend evenly above and below the axis. They may also extend out in only one direction from the axis. In the latter case, the location of the axis determines which way the tick marks should extend.
The direction of the tick styles refer to axes that are specified in Plot Normalized or Data coordinates. Axes that are specified in other coordinates may behave differently. For instance, an axis specified in Frame Normalized coordinates has the reference point at the center of the frame rather than the center of the plot when determining the direction of "inside" or "outside".
The following tick values are supported:
| Name | Enumeration | Numeric | Description |
| inside | chips_inside | 0 | tick marks face towards the center of the plot |
| outside | chips_outside | 1 | tick marks face away from the center of the plot |
| centered | chips_centered | 2 | tick marks are centered on the axis baseline |
![]() |
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. |