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

Skip the navigation links
Last modified: 9 July 2009

URL: http://cxc.harvard.edu/chips4.1/gallery/axes_move.sl.html

Gallery: Moving axes (S-Lang)

Examples


Moving the axes so they go through (0,0)

[ChIPS output]
Postscript version
add_curve("atan.fits[cols X,Y]",{"symbol.style","none"});

set_plot({"leftmargin",0.1,"bottommargin",0.1});

variable cid = ChipsId;
cid.coord_sys = DATA;
move_axis(cid,0.0,0.0,0);

set_axis({"majortick.style","outside","minortick.style","outside"});

When the axes were created for this plot they were placed using the plot-normalized coordinate system (e.g. the X axis was placed at yplot normalized = 0). This means that, unless explicitly specified, the move_axis call will assume the coordinates it is given are also in the plot-normalized coordinate system. Since we want to move the axes to (0,0) in the data coordinate system, we have to send in a ChipsId structure with the coord_sys field set to DATA.

Whilst the axes move, the borders - in this case "bx1" and "by1" - remain, which is why there are tick marks around all four edges of the plot. The other examples in this section show how the border properties can be changed (Moving the axes and using a boxed border) or hidden completely (Moving the axes with an open border).


Moving the axes and using a boxed border

[ChIPS output]
Postscript version
variable plt = ChipsPlot;
plt.style = "boxed";
variable crv = ChipsCurve;
crv.symbol.style = "none";
add_curve("atan.fits[cols X,Y]",[plt,crv]);

variable cid = ChipsId;
cid.coord_sys = DATA;
move_axis(cid,0.0,0.0,0);

set_axis({"majortick.style","outside","minortick.style","outside"});
set_plot({"leftmargin",0.1,"bottommargin",0.1});

Moving the axes with an open border

[ChIPS output]
Postscript version
variable plt = ChipsPlot;
plt.style = "open";
variable crv = ChipsCurve;
crv.symbol.style = "none";
add_curve("atan.fits[cols X,Y]",[plt,crv]);

variable cid = ChipsId;
cid.coord_sys = DATA;
move_axis(cid,0.0,0.0,0);

set_axis({"majortick.style","outside","minortick.style","outside"});
set_plot({"leftmargin",0.1,"bottommargin",0.1});
Last modified: 9 July 2009


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.