Next Previous Up Contents
Next: plot2sky: Draws a sky plot
Up: plot2plane: Draws a plane plot
Previous: Usage

### B.10.2 Examples

Here are some examples of `plot2plane`:

```stilts plot2plane yflip=true layer_1=mark in_1=cat.fits x_1=BMAG-RMAG y_1=BMAG
```
This is a colour-magnitude diagram where the input table has columns named RMAG and BMAG. The Y axis is inverted so that the magnitude values increase downwards not up. The plot is displayed in a window on the screen, and may be panned and zoomed with the mouse.
```stilts plot2plane layer=histogram in=hip_main.fits x=plx xlog=true
xlabel=Parallax ylabel=
```
Plots a histogram of parallaxes for Hipparcos data, with a logarithmic X axis. The axes are labelled explicitly, with an empty string in the case of the Y axis.
```stilts plot2plane xpix=600 ypix=500
in=gavo_g2.fits x=X y=Y
layer_m=mark shape_m=cross size_m=4
layer_v=xyvector xdelta_v=velx ydelta_v=vely scale_v=2
out=velocities.pdf
```
Two layers are plotted, point markers representing position (4 pixels radius, shaped like crosses) and vectors representing velocity. Both markers and vectors are coloured according to the direction (arctan(vely/velx)) of the arrows, so it's easy to see points moving in similar directions; the "hue" colour map is good for this, since it's periodic, so values of +Pi and -Pi have the same colour. Since it's not very revealing in this case, display of the aux axis colour ramp beside the plot has been turned off. Since the X and Y coordinates and the colouring is common to both layers, the relevant parameters can given without suffixes to avoid having to repeat them. Output is to a PDF file.
```stilts plot2plane xmin=0 xmax=6.283 ymin=-1 ymax=1 xlabel=Time
layer=function axis=horizontal xname=time fexpr='sin(time)'
dash=3,2 thick=4 color=ee6aa7
```
Plots a sine curve to the screen. Initially the view is of one period, but you can pan and zoom interactively to see any range. The line is plotted in hot pink, four pixels wide, with a custom dash pattern. Since the function layer type has no data coordinates, no input table is required. The layer suffix here is the empty string; since there's only one layer, it doesn't cause any problems.
```stilts plot2plane ylog=true xflip=true xmin=-5.2 xmax=3.8 ymin=250 ymax=3.5e5
in1=6dfgs_E7.fits x1=bmag-rmag y1=vel
layer1a=mark color1a=cyan
layer1b=contour color1b=yellow smooth1b=9 scaling1b=log
layer1c=mark icmd1c='every 35;select star'
shape1c=filled_triangle_down size1c=5 color1c=red
layer2=function fexpr2='exp(x*2+12)' color2=black antialias2=true
dash2=dash thick2=3
leglabel1a=Population leglabel1c=Sample legpos=.95,.95 legseq=1a,1c
fontsize=16 texttype=latex ylabel="v\,/\,km.s^{-1}" xlabel=colour
```
There are four layers: 1a, 1b and 1c use the same positional data from the same input file, so the positional coordinates common to them are given the suffix "1". Layer "2" is unrelated, and has no input data, since it's just an analytic function. The legend is positioned to taste, and its content is manipulated so that only datasets 1a and 1c are described, and they are given custom names (the default would be their suffix names).

Next Previous Up Contents
Next: plot2sky: Draws a sky plot
Up: plot2plane: Draws a plane plot
Previous: Usage

STILTS - Starlink Tables Infrastructure Library Tool Set