|
|
|
|
Gallery: Moving axes (S-Lang)Examples
Moving the axes so they go through (0,0)
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
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
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});
|
![]() |
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. |