events

Plot event symbols and labels for a moment in time

Synopsis

gmt events [ table ] -Jparameters -Rwest/east/south/north[/zmin/zmax][+r] -Ssymbol[size[units]] [ -B[p|s]parameters ] [ -Ccpt ] [ -D[j|J]dx[/dy][+v[pen]] ] [ -Es|t[+o|Odt][+rdt][+pdt][+ddt][+fdt] ] [ -F[+aangle][+ffont][+jjustify][+r[first]|+z[format]] ] [ -Gcolor ] [ -L[length|t] ] [ -Mi|s|t[val1][+cval2] ] [ -Qprefix ] [ -Tnow ] [ -V[level] ] [ -Wpen ] [ -U[stamp] ] [ -Wpen ] [ -X[a|c|f|r][xshift[u]] ] [ -Y[a|c|f|r][yshift[u]] ] [ -bibinary ] [ -dinodata ] [ -eregexp ] [ -fflags ] [ -hheaders ] [ -iflags ] [ -pflags ] [ -:[i|o] ] [ --PAR=value ]

Note: No space is allowed between the option flag and the associated arguments.

Description

Reads (x, y[, z] [, size], time [, length]) data from files [or standard input] and plots how the symbol for each event should look for the specified now time. The reason they may differ is that events may have different lengths and we may wish to accentuate the symbol attributes in ways to draw attention to an event when it first happens and perhaps tone it down after a while to reduce clutter and focus on more recent events. This module is typically used in conjunction with movie scripts where the implicit loop over time is used to call it over a time-sequence and thus plot symbols as events unfold.

Required Arguments

-Jparameters (more …)
Select map projection.
-Rxmin/xmax/ymin/ymax[+r][+uunit] (more …)
Specify the region of interest.

For perspective view p, optionally append /zmin/zmax. (more …)

-Ssymbol[size[units]]
Specify the symbol to use for the event. Optionally, append symbol size with units from (c|i|p). If no size is given then we read an event-specific size from the data file’s third column (fourth if -C is used). Note: Not all the symbols that are available in psxy can be used here. At the moment we only support the basic symbols and custom symbols; bars, vectors, ellipses, fronts, decorated and quoted lines cannot be specified.
-Tnow
Sets the current plot time. If absolute times are used you must also use -fT.

Optional Arguments

table
One or more ASCII (or binary, see -bi[ncols][type]) data table file(s) holding a number of data columns. If no tables are given then we read from standard input.
-B[p|s]parameters (more …)
Set map boundary frame and axes attributes.
-Ccpt
Use the cpt to convert z values given in the optional third column to assign symbol colors.
-D[j|J]dx[/dy][+v[pen]]
Offsets the text from the projected (x,y) point by dx,dy [0/0]. If dy is not specified then it is set equal to dx. Use -Dj to offset the text away from the point instead (i.e., the text justification will determine the direction of the shift). Using -DJ will shorten diagonal offsets at corners by sqrt(2). Optionally, append +v which will draw a line from the original point to the shifted point; append a pen to change the attributes for this line.
-Es|t[+o|Odt][+rdt][+pdt][+ddt][+fdt]
Sets the time knots for the symbol or text time-functions. Append +o to shift the event start and end times by a constant offset (basically shifting the event in time by dt; or use +O to only shift the start time, effectively shortening the duration of the event), +r to indicate the duration of the rise phase, +p to set the duration of the plateau phase, +d to specify the duration of the decay phase, and +f to set the duration of the fade phase. These are all optional [and default to zero], and can be set separately for symbols and texts. If neither s or t is given then we set the time knots for both features.
-F[+aangle][+ffont][+jjustify][+r[first] | +z[format]]
By default, event label text will be placed horizontally, using the primary annotation font attributes (FONT_ANNOT_PRIMARY), and centered on the data point. Use this option to override these defaults by specifying up to three text attributes (font, angle, and justification) directly on the command line. Use +f to set the font (size,fontname,color), +a to set the angle, and +j to set the justification. Normally, the text to be plotted is the trailing text. Instead, use +r to use the record number (counting up from first [0]) or +z to format incoming z values (requires -C) to a string using the supplied format [use FORMAT_FLOAT_MAP].
-Gfill (more …)
Set constant shade or color for all symbols.
-Jz|Zparameters (more …)
Set z-axis scaling; same syntax as -Jx.
-L[length|t]
Specify the length (i.e., duration) of the event. Append a length if all events have the same length, append t if end-times instead of lengths are given in the file after the time column, or leave blank if lengths can be read from the input file after the time column.
-Mi|s|t[val1][+cval2]
Sets the initial intensity, size magnification, or transparency of the symbol during the rise interval [1, 1, and 100, respectively]. Optionally, use +c to set the corresponding terminal value during the coda [100].
-Qprefix
Save the intermediate event symbols and labels to permanent files instead of removing when done. Files will be called prefix_symbols.txt and prefix_labels.txt.
-U[label][+c][+jjust][+odx/dy] (more …)
Draw GMT time stamp logo on plot.
-V[level] (more …)
Select verbosity level [c].
-Wpen
Specify symbol outline pen attributes [Default is no outline].
-bi[ncols][t] (more …)
Select native binary format for primary input. [Default is 3 input columns].
-dinodata (more …)
Replace input columns that equal nodata with NaN.
-e[~]”pattern” | -e[~]/regexp/[i] (more …)
Only accept data records that match the given pattern.
-f[i|o]colinfo (more …)
Specify data types of input and/or output columns.
-h[i|o][n][+c][+d][+rremark][+rtitle] (more …)
Skip or produce header record(s).
-icols[+l][+sscale][+ooffset][,][,t[word]] (more …)
Select input columns and transformations (0 is first column, t is trailing text, append word to read one word only).
-p[x|y|z]azim[/elev[/zlevel]][+wlon0/lat0[/z0]][+vx0/y0] (more …)
Select perspective view.
-:[i|o] (more …)
Swap 1st and 2nd column on input and/or output.
-^ or just -
Print a short message about the syntax of the command, then exits (NOTE: on Windows just use -).
-+ or just +
Print an extensive usage (help) message, including the explanation of any module-specific option (but not the GMT common options), then exits.
-? or no arguments
Print a complete usage (help) message, including the explanation of all options, then exits.
--PAR=value
Temporarily override a GMT default setting; repeatable. See gmt.conf for parameters.

The three time-functions

Events typically have either a finite length, e.g., the temporal extent of the reign of a particular monarch, or are infinite. Here, infinite simply means its length exceeds the temporal extent of the time we are plotting. In a movie, a basic representation of these events as points on a map would be to start plotting the symbol when the event starts and then keep the symbol visible on all frames until the event ends (or never stop plotting them in the infinite length case). However, to draw attention to the arrival of a new event we can temporarily change three aspects of the symbol: Its size, color intensity, and transparency. You can think of these three attributes as functions of time. For some option settings, Figure Symbol size function illustrates how the symbol size may vary through the timespan of the movie.

_images/psevents_size.png

Implied evolution of one symbol’s size-variation as a function of time given the time-knots from -Es and the magnifications from -Ms. Here we temporarily magnify the symbol size five times before decaying to the intended size and eventually shrink it further down to a small size during the fade and coda phases.

Similarly, to draw attention to the newly arrived event you may want to whiten the color temporarily; this can be done via the -Mi option and Figure Symbol intensity function illustrates how intensity may vary accordingly.

_images/psevents_intensity.png

Implied evolution of one symbol’s color intensity as a function of time given the time-knots from -Es and the intensities from -Mi. Here we seek to whiten the symbol during the event arrival, as well as darken it during a permanent code phase.

Finally, for finite events you may wish to either fade them out completely or simply fade them to a constant but still visible transparency; this future stage is referred to as the coda and levels can be specified via the -Mt option. Figure Symbol transparency function illustrates how transparency may vary through time.

_images/psevents_transparency.png

Here we show how a symbol may go from being invisible to reach full opaqueness at the event begin time, then finally fade to a near-invisible stage after reaching its length.

While shown in these examples, the rise, plateau, fade, and coda periods are all optional and can be selected or ignored as you wish via -E. You can choose to specify any or none of the three time histories. By default the symbol size is constant, there is no intensity variation, and all symbols are opaque. If trailing text is plotted (requires -Et) then only a transparency time-function is used.

Examples

To show the display of events visible for May 1, 2018 given the catalog of large (>5) magnitude earthquakes that year, using a 2-day rise time during which we boost symbol size by a factor of 5 and wash out the color, followed by a decay over 6 days and then a final shrinking to half size and darken the color, we may try

gmt begin layer
  gmt convert "https://earthquake.usgs.gov/fdsnws/event/1/query.csv?starttime=2018-01-01%2000:00:00&endtime=2018-12-31%2000:00:00&minmagnitude=5&orderby=time-asc" \
     -i2,1,3,4+s50,0 -hi1 > q.txt
  gmt makecpt -Cred,green,blue -T0,70,300,10000 > q.cpt
  gmt events -Rg -JG200/5/6i -Baf q.txt -SE- -Cq.cpt --TIME_UNIT=d -T2018-05-01T -Es+r2+d6 -Ms5+c0.5 -Mi1+c-0.6 -Mt+c0
gmt end show

See Also

gmt, gmtcolors, plot, movie