using GMT
x = linspace(0, 4*pi, 50);
stairs(x, sin.(x), show=true)
Reads (x,y) pairs and plot stairstep graph. The input can either be a file name of a file with at least two columns (x,y), but optionally more, a GMTdatset object with also two or more columns, or direct x,y inputs
| stairs(x,y, …) plots the elements in y at the locations specified by x. The inputs x,y can be vectors or a vector and a matrix, both with the same number of rows. |
|---|
stairs(D::GMTdatset, yvar, …) plots the specified variable from the GMTdatset against the row indices of the table. To plot one set of y-values, specify one variable for yvar. This can take the form of column names or column numbers. To plot multiple sets of y-values, specify multiple variables for yvar. Example yvar=:Y or yvar=(2,3), or yvar=[:Y, :Z1, :Z2]. |
stairs(D::GMTdatset,xvar,yvar) plots the variables xvar and yvar from the table D. You can specify one or multiple variables for yvar and one only for xvar.
This module is a subset of plot to make it simpler to draw stair plots. So not all (fine) controlling parameters are not listed here. For the finest control, user should consult the plot module. |
| Parameters |
step : – step=:post | step=:pre
With step=:post, the default, lines move first along x for cartesian plots or the parallels for geographic and then along y or the meridians. step=:pre (or whatever != :post), lines move first along y for cartesian plots or the meridians for geographic and then along x or the parallels.
B or axes or frame
Set map boundary frame and axes attributes. Default is to draw and annotate left, bottom and vertical axes and just draw left and top axes. More at [frame](../common_opts/opt_B.html)
J or proj or projection : – proj=
Select map projection. More at [proj](../common_opts/opt_J.html)
R or region or limits : – limits=(xmin, xmax, ymin, ymax) | limits=(BB=(xmin, xmax, ymin, ymax),) | limits=(LLUR=(xmin, xmax, ymin, ymax),units=“unit”) | …more
Specify the region of interest. More at [limits](../common_opts/opt_R.html). For perspective view view, optionally add zmin,zmax. This option may be used to indicate the range used for the 3-D axes. You may ask for a larger w/e/s/n region to have more room between the image and the axes.
G or markerfacecolor or MarkerFaceColor or markercolor or mc or fill
Select color or pattern for filling of symbols [Default is no fill]. Note that plot will search for fill and pen settings in all the segment headers (when passing a GMTdaset or file of a multi-segment dataset) and let any values thus found over-ride the command line settings (but those must be provided in the terse GMT syntax). See [Setting color](../common_features/color.html) for extend color selection (including color map generation).
W or pen=pen
Set pen attributes for the arrow stem [Defaults: width = default, color = black, style = solid]. See [Pen attributes](../common_features/pens.html) and [Vector attributes](../common_features/arrows_control.html) for arrow line terminations.
U or time_stamp : – time_stamp=true | time_stamp=(just=“code”, pos=(dx,dy), label=“label”, com=true)
Draw GMT time stamp logo on plot. More at [timestamp](../common_opts/opt_U.html)
V or verbose : – verbose=true | verbose=level
Select verbosity level. More at [verbose](../common_opts/opt_V.html)
X or xshift or x_offset : xshift=true | xshift=x-shift | xshift=(shift=x-shift, mov=“a|c|f|r”)
Shift plot origin. More at [xshift](../common_opts/opt_X.html)
Y or yshift or y_offset : yshift=true | yshift=y-shift | yshift=(shift=y-shift, mov=“a|c|f|r”)
Shift plot origin. More at [yshift](../common_opts/opt_Y.html)
figname or savefig or name : – figname=name.png
Save the figure with the figname=name.ext where ext chooses the figure image format.
Create a stairs plot of sine evaluated at 50 equally spaced values between 0 and 4π.
Create a stairs plot of sine and a cosine evaluated at same points as above and add a circle marker at the points location. Note that now we are selectiong the columns from teir names in the D GMTdataset.