STILTS-PLOT2D(1)

πŸ’– STILTS-PLOT2D(1) β€” the plot2d command, explained by your resident Unix bestie πŸ’–

okay so this is stilts plot2d, a Stilts command, and this particular page is so long it got split into multiple parts β€” this is part 1, so don't @ me for the ending yet, we're still going 🫢


✨ NAME ✨

stilts-plot2d β€” Old-style 2D Scatter Plot. that's it, that's the name, it's giving "vintage but still works" πŸŽ€


🌸 SYNOPSIS 🌸

stilts plot2d [xpix=<int-value>] [ypix=<int-value>]
              [font=dialog|serif|...] [fontsize=<int-value>]
              [fontstyle=plain|bold|italic|bold-italic]
              [legend=true|false] [title=<value>]
              [omode=swing|out|cgi|discard|auto] [out=<out-file>]
              [ofmt=png|png-transp|gif|jpeg|pdf|svg|eps|eps-gzip]
              [inN=<table>] [ifmtN=<in-format>] [istreamN=true|false]
              [cmdN=<cmds>] [xdataN=<expr>] [ydataN=<expr>]
              [auxdataN=<expr>] [xlo=<float-value>] [ylo=<float-value>]
              [auxlo=<float-value>] [xhi=<float-value>] [yhi=<float-
              value>] [auxhi=<float-value>] [xlog=true|false]
              [ylog=true|false] [auxlog=true|false] [xflip=true|false]
              [yflip=true|false] [auxflip=true|false] [xlabel=<value>]
              [ylabel=<value>] [auxlabel=<value>] [xerrorN=<expr>|[<lo-
              expr>],[<hi-expr>]] [yerrorN=<expr>|[<lo-expr>],[<hi-
              expr>]] [auxshader=rainbow|pastel|...] [txtlabelN=<value>]
              [subsetNS=<expr>] [nameNS=<value>]
              [colourNS=<rrggbb>|red|blue|...]
              [shapeNS=filled_circle|open_circle|...] [sizeNS=<int-
              value>] [transparencyNS=<int-value>]
              [lineNS=DotToDot|LinearRegression] [linewidthNS=<int-
              value>] [dashNS=dot|dash|...|<a,b,...>]
              [hideNS=true|false] [errstyleNS=lines|capped_lines|...]
              [grid=true|false] [antialias=true|false]
              [sequence=<suffix>,<suffix>,...]

🌈 DESCRIPTION 🌈

okay bestie, listen. This section describes a deprecated command. It still works β€” it's not dead, it's just... retired-adjacent 😭 β€” but you are advised to use the more capable plot2plane instead. it's giving "your ex still texts back but like, move on".

plot2d does two-dimensional scatter plots, and it sends the output either to a graphical display or writes it out to a file in some vector or bitmapped graphics format. the way it works is: you hand it values for one or more X and Y datasets, described in terms of table columns, and it generates a plot with a point for every row. iconic behaviour honestly.

there are so many options for configuring the detailed appearance of the plot β€” like, a truly unhinged number β€” but in its simplest form invocation is quite straightforward. if you want the full discussion on how to actually use the plotting commands, go read SUN/256 πŸ’…


πŸ‘‘ OPTIONS πŸ‘‘

πŸŽ€ the basics (size, fonts, legend, title)

  • xpix=<int-value> β€” the width of the output graphic, in pixels. that's it. that's the whole vibe.
  • ypix=<int-value> β€” the height of the output graphic, in pixels.
  • font=dialog|serif|... β€” picks the font used for textual annotation of the plot, axes and all that. at least the following fonts will be available:
    • serif
    • sansserif
    • monospaced
    • dialog
    • dialoginput

and also a whole range of system-dependent fonts, possibly including:

  • dejavu_sans
  • dejavu_sans_mono
  • dejavu_serif
  • fontsize=<int-value> β€” sets the font size used for plot annotations.
  • fontstyle=plain|bold|italic|bold-italic β€” gives a style in which the font is to be applied for plot annotations. your options are plain, bold, italic and bold-italic. go bold, live a little ✨
  • legend=true|false β€” determines whether a legend shows which plotting style is used for each data set. defaults to true if there's more than one set, false otherwise. it's smart like that 🧚
  • title=<value> β€” a one-line title to display at the top of the plot. make it cute.

πŸ¦‹ output stuff (where does the plot actually GO)

  • omode=swing|out|cgi|discard|auto β€” determines how the drawn plot will be output, see SUN/256. the choices:
    • swing: the plot will be displayed in a window on the screen. this plot is "live" β€” it can be resized and (except for old-style plots) navigated around with mouse actions in the same way as plots in TOPCAT. main character energy fr.
    • out: the plot will be written to a file given by out using the graphics format given by ofmt.
    • cgi: the plot will be written in a way suitable for CGI use direct from a web server. the output is in the graphics format given by ofmt, preceded by a suitable "Content-type" declaration.
    • discard: plot is drawn, but discarded. there is no output. the plot said "i'm not being perceived today" πŸ’€
    • auto: behaves as swing or out mode depending on presence of out parameter.
  • out=<out-file> β€” the location of the output file. usually a filename to write to. but if it's equal to the special value - the output will be written to standard output. classic.
  • ofmt=png|png-transp|gif|jpeg|pdf|svg|eps|eps-gzip β€” the graphics format the plot is written to the output file in, see SUN/256. one of:
    • png: PNG
    • png-transp: PNG with transparent background
    • gif: GIF
    • jpeg: JPEG
    • pdf: Portable Document Format
    • svg: Scalable Vector Graphics
    • eps: Encapsulated PostScript
    • eps-gzip: Gzipped Encapsulated PostScript

it may default to a sensible value depending on the filename given by out.


πŸ’œ input tables (the inN / ifmtN / istreamN / cmdN crew)

quick heads-up bestie: a whole bunch of options in this command come in numbered families β€” inN, ifmtN, istreamN, cmdN, xdataN, ydataN... the N is a stand-in for the table number. so if you've got three tables, you get xdata1, xdata2, xdata3 etc. 🌸
  • inN=<table> β€” the location of the input table. this may take one of the following forms:
    • A filename.
    • A URL.
    • The special value -, meaning standard input. in this case the input format must be given explicitly using the ifmtN parameter. note that not all formats can be streamed in this way.
    • A scheme specification of the form :<scheme-name>:<scheme-args>.
    • A system command line with either a "<" character at the start, or a "|" character at the end ("<syscmd" or "syscmd|"). this executes the given pipeline and reads from its standard output. this will probably only work on unix-like systems.

in any case, compressed data in one of the supported compression formats (gzip, Unix compress or bzip2) will be decompressed transparently. no extra work for you, slay 🫢

  • ifmtN=<in-format> β€” specifies the format of the input table as specified by parameter inN. the known formats are listed in SUN/256. this flag can be used if you know what format your table is in. if it has the special value (auto) (the default), then an attempt will be made to detect the format of the table automatically. this cannot always be done correctly however, in which case the program will exit with an error explaining which formats were attempted. this parameter is ignored for scheme-specified tables.
  • istreamN=true|false β€” if set true, the input table specified by the inN parameter will be read as a stream. it is necessary to give the ifmtN parameter in this case. depending on the required operations and processing mode, this may cause the read to fail (sometimes it's necessary to read the table more than once 😭). it's not normally necessary to set this flag; in most cases the data will be streamed automatically if that's the best thing to do. however it can sometimes result in less resource usage when processing large files in certain formats (such as VOTable). this parameter is ignored for scheme-specified tables.
  • cmdN=<cmds> β€” specifies processing to be performed on the table. the value of this parameter is one or more of the filter commands described in SUN/256. if more than one is given, they must be separated by semicolon characters (";"). this parameter can be repeated multiple times on the same command line to build up a list of processing steps. the sequence of commands given in this way defines the processing pipeline which is performed on the table. pipeline!! we love a pipeline ✨

commands may alternatively be supplied in an external file, by using the indirection character '@'. thus a value of "@filename" causes the file filename to be read for a list of filter commands to execute. the commands in the file may be separated by newline characters and/or semicolons, and lines which are blank or which start with a '#' character are ignored. a backslash character '\fR' at the end of a line joins it with the following line.


πŸ’« data columns (X, Y and the mysterious "aux")

  • xdataN=<expr> β€” gives a column name or expression for the x axis data for table N. the expression is a numeric algebraic expression based on column names as described in SUN/256
  • ydataN=<expr> β€” gives a column name or expression for the y axis data for table N. the expression is a numeric algebraic expression based on column names as described in SUN/256
  • auxdataN=<expr> β€” gives a column name or expression for the aux axis data for table N. the expression is a numeric algebraic expression based on column names as described in SUN/256

(no period at the end of those, because the manpage said so and we respect the source material πŸ’…)


πŸ”₯ axis limits (lo)

  • xlo=<float-value> β€” the lower limit for the plotted x axis. if not set, a value will be chosen which is low enough to accommodate all the data. so you can just... not, and it'll handle it for you.
  • ylo=<float-value> β€” the lower limit for the plotted y axis. if not set, a value will be chosen which is low enough to accommodate all the data.
  • auxlo=<float-value> β€” the lower limit for the plotted aux axis. if not set, a value will be chosen which is low enough to accommodate all the data.

⭐ axis limits (hi)

  • xhi=<float-value> β€” the upper limit for the plotted x axis. if not set, a value will be chosen which is high enough to accommodate all the data.
  • yhi=<float-value> β€” the upper limit for the plotted y axis. if not set, a value will be chosen which is high enough to accommodate all the data.
  • auxhi=<float-value> β€” the upper limit for the plotted aux axis. if not set, a value will be chosen which is high enough to accommodate all the data.

🌸 log scales (the glow-up of your axes)

  • xlog=true|false β€” if false (the default), the scale on the x axis is linear; if true it is logarithmic.
  • ylog=true|false β€” if false (the default), the scale on the y axis is linear; if true it is logarithmic.
  • auxlog=true|false β€” if false (the default), the scale on the aux axis is linear; if true it is logarithmic.

🧚 flipped axes (yes, backwards on purpose)

  • xflip=true|false β€” if set true, the scale on the x axis will increase in the opposite sense from usual (e.g. right to left rather than left to right).
  • yflip=true|false β€” if set true, the scale on the y axis will increase in the opposite sense from usual (e.g. right to left rather than left to right).

okay so that's where part 1 wraps, and there's more β€” the plot2d story is not over, bestie. keep scrolling for the rest of the options, no sign-off, no goodbye, we're mid-conversation πŸ«ΆπŸ’–
  • auxflip=true|false β€” set this to true and the scale on the aux axis flips its usual direction, like it's going right-to-left instead of left-to-right. Iconic little plot twist πŸ’«
  • xlabel=<value> β€” the label that annotates axis x. If you don't give it a value, a default one based on the plotted data gets used instead. It's giving "I'll handle it myself" energy πŸ’…
  • ylabel=<value> β€” same deal but for axis y. No value? Then a default based on the plotted data steps in. πŸŽ€
  • auxlabel=<value> β€” and for axis aux ✨ supply a label, or let a default computed from the plotted data do its thing.
  • xerrorN=<expr>|[<lo-expr>],[<hi-expr>] β€” gives the expressions for the errors on the X coordinates for table N. Bestie, you've got options here:
    • <expr>: symmetric error value
    • <lo-expr>,<hi-expr>: distinct lower and upper error values
    • <lo-expr>,: lower error value only
    • ,<hi-expr>: upper error value only
    • null: no errors

In every case the expression is a numeric algebraic expression based on column names, as described in SUN/256. No cap 🧒

  • yerrorN=<expr>|[<lo-expr>],[<hi-expr>] β€” the same thing but for the errors on the Y coordinates for table N. The forms on offer:
    • <expr>: symmetric error value
    • <lo-expr>,<hi-expr>: distinct lower and upper error values
    • <lo-expr>,: lower error value only
    • ,<hi-expr>: upper error value only
    • null: no errors

And again, each expression is a numeric algebraic expression based on column names, as per SUN/256. 🌈

  • auxshader=rainbow|pastel|... β€” decides how the data from the auxiliary axes gets displayed, and usually it's some kind of colour ramp. The colour fixing options are:
    • rainbow
    • pastel
    • standard
    • heat
    • colour
    • hue
    • greyscale
    • red-blue

and the colour modifying options are:

  • hsv_h
  • hsv_s
  • hsv_v
  • intensity
  • rgb_red
  • rgb_green
  • rgb_blue
  • yuv_y
  • yuv_u
  • yuv_v
  • transparency

okay colour theory main character moment πŸ¦‹

  • txtlabelN=<value> β€” an expression that labels each plotted point. If you give it one, the text (or number) you get from evaluating the expression gets written near every point that's plotted. It's like name tags but for data πŸ’–
  • subsetNS=<expr> β€” the selection criterion for the subset labelled "NS". It's a boolean expression, so it can be the name of a boolean-valued column or literally any other boolean-valued expression. Rows where the expression evaluates true get included in the subset, and the ones where it evaluates false do not. Vibe check: passed βœ… / failed ❌
  • nameNS=<value> β€” hands you a name to use for a subset with the symbolic label NS. That name is what shows up in the legend, if a legend is being displayed. πŸ‘‘
  • colourNS=<rrggbb>|red|blue|... β€” defines the colour of the plotted markers. The value can be a 6-digit hexadecimal number giving the red, green and blue intensities, e.g. "ff00ff" for magenta. Or it can be the name of one of the pre-defined colours. Those are currently red, blue, green, grey, magenta, cyan, orange, pink, yellow, black and white.

For most purposes, either the American or the British spelling is accepted for this parameter name. (transatlantic slay fr fr 🌸)

  • shapeNS=filled_circle|open_circle|... β€” defines the shapes for the markers plotted in data set NS. Take your pick:
    • filled_circle
    • open_circle
    • cross
    • x
    • open_square
    • open_diamond
    • open_triangle_up
    • open_triangle_down
    • filled_square
    • filled_diamond
    • filled_triangle_up
    • filled_triangle_down

a whole wardrobe of little guys πŸ”₯

  • sizeNS=<int-value> β€” the marker size in pixels for the markers plotted in data set NS. If the value is negative, an attempt will be made to use a suitable size according to how many points there are to be plotted. Let the algorithm pick, honestly πŸ™ˆ
  • transparencyNS=<int-value> β€” determines the transparency of the plotted markers for data set NS. A value of <n> means opacity is only achieved (i.e. the background is only blotted out) when <n> pixels of this colour have been plotted on top of each other.

The minimum value is 1, which means opaque markers.

  • lineNS=DotToDot|LinearRegression β€” decides what line, if any, gets plotted along with the data points. The options:
    • null: No line is plotted.
    • DotToDot: Each point is joined to the next one in sequence by a straight line.
    • LinearRegression: A linear regression line is plotted based on all the points which are visible in the plot. Note that the regression coefficients take no account of points out of the visible range.

⚠️ heads up on that last one β€” the regression genuinely just ✨ignores✨ everything outside the visible range, that's not a bug, that's the spec.

  • linewidthNS=<int-value> β€” sets the line width in pixels for any lines drawn in data set NS.

Only has an effect if the lineNS parameter is set to draw lines. (no line, no width, periodt πŸ’€)

  • dashNS=dot|dash|...|<a,b,...> β€” defines the dash style for any lines drawn in data set NS. To generate a dashed line the value may be one of the named dash types:
    • dot
    • dash
    • longdash
    • dotdash

or it may be a comma-separated string of on/off length values such as "4,2,8,2". A null value indicates a solid line.

Only has an effect if the lineNS parameter is set to draw lines. (yes, same rule again bestie 🌷)

  • hideNS=true|false β€” says whether the actual markers plotted for each point should be hidden. Normally this is false, but you might wanna set it to true if the point positions are being revealed in some other way β€” for instance by error markers or lines drawn between them. Sneaky. I respect it πŸ’œ
  • errstyleNS=lines|capped_lines|... β€” defines the way error bars (or ellipses, or...) will be represented for data set NS if errors are being displayed. Available:
    • none
    • lines
    • capped_lines
    • caps
    • arrows
    • ellipse
    • crosshair_ellipse
    • rectangle
    • crosshair_rectangle
    • filled_ellipse
    • filled_rectangle

error aesthetics are a whole personality πŸŽ€

  • grid=true|false β€” if true, grid lines are drawn on the plot. If false, they're absent. Simple as. ✨
  • antialias=true|false β€” controls whether lines are drawn using antialiasing, where applicable. If lines are being drawn to a bitmapped-type graphics output format, setting this parameter to true smooths the lines out by using gradations of colour for diagonal lines, and setting it false simply sets each pixel in the line to on or off. For vector-type graphics output formats, or for cases in which no diagonal lines are drawn, the setting of this parameter has no effect. Setting it true may slow the plot down slightly.
so cute, so smooth, so... a tiny bit slower 😭 your call
  • sequence=<suffix>,<suffix>,... β€” controls the sequence in which different datasets and subsets get plotted. This affects which symbols are plotted on top of β€” and so potentially obscure β€” which other ones. The value of this parameter is a comma-separated list of the "NS" suffixes which appear on the parameters that apply to subsets. The sets which are named will be plotted in order, so the first-named one is at the bottom (most likely to be obscured). Note that if this parameter is supplied, then only those sets which are named will be plotted β€” so this parameter can also be used to restrict which plots appear (though it may not be the most efficient way of doing this). If no explicit value is supplied for this parameter, sets get plotted in some sequence decided by STILTS (probably alphabetic by suffix).

stacking order is genuinely the most drama-filled part of plotting and I stand by that πŸ’…


🌟 SEE ALSO 🌟

If the package stilts-doc is installed, the full documentation SUN/256 is available in HTML format:

file:///usr/share/doc/stilts/sun256/index.html

πŸ’– VERSION πŸ’–

STILTS version 3.5.4-debian

This is the Debian version of Stilts, which lack the support of some file formats and network protocols. For differences see

file:///usr/share/doc/stilts/README.Debian

πŸ‘‘ AUTHOR πŸ‘‘

Mark Taylor (Bristol University)


and that's the whole page bestie 🫢 it's giving STILTS-PLOT2D(1), dated Mar 2017, and honestly? she ate. go plot something iconic πŸ’…βœ¨πŸŒΈ

πŸ“¦ where this page comes from