sidfex.plot.speedangle.template: Create clean speed-angle-plot for later use

View source: R/sidfex.plot.speedangle.template.R

sidfex.plot.speedangle.templateR Documentation

Create clean speed-angle-plot for later use

Description

This function creates an empty speed-angle-plot in a specified format ("device"), i.e. a template for adding lines or point clusters later.

Usage

  sidfex.plot.speedangle.template(device="pdf", file=paste0("~/sidfex.plot.speedangle.template.",device), width=NULL,
                                   labels=TRUE,labels.cex=1,bg.lines.lwd=labels.cex,...) 

Arguments

device

a character specifying which graphics device to use, or NULL for the default device. Default is device='jpeg'.

file

a character specifying the output file (if device!=NULL). Default is file=paste0("~/sidfex.plot.speedangle.",device).

width

a scalar specifying the width of the resulting figure. The height will be equal. If NULL (default), a (hopefully) useful value depending on device is used. It is recommended to to use values around 600 to 800. Greater values are also possible, but then you have to adjust the scales of labels as well.

labels

a logical value specifying whether or not labels shall be plotted. Default is TRUE.

labels.cex

a numerical value specifying the amount by which labels shall be magnified relative to the default.

bg.lines.lwd

a numerical value specifying the width of the background lines (marking the 'coordinate system').

...

Further graphical parameters to be forwarded to points (see documentation of points for details).

Value

The function returns nothing but saves the template to the specified destination.

Note

PLEASE NOTE: If you use the saved image and want to plot data on it without (!) using sidfex.plot.speedangle2template, you have to multiply the x- and y-coordinates by 1/1.08 right before calling points or lines; OR you rescale the image after loading it in R during your call of rasterImage (then you need to multiply xlim and ylim by 1.08). This might appear cumbersome, but it is necessary as R automatically adds a 4%-margin around the actual axes in each direction when saving, such that plotting the image into axes with presumably the same range (usually -2 to 2 in both directions) will shrink the image a little - which might remain unnoticed in the worst case. This is why we highly recommend using sidfex.plot.speedangle2template, then you don't have to think about this issue at all!

So far, there is no functionality to read an PDF image for further plotting, it is still possible to create them with this function though.

Also, this function will be modified in a way that it can be called inside sidfex.plot.speedangle, i.e. it will provide the template directly without the need for saving and reloading an image. This is work in progress.

Author(s)

Simon Reifenberg

See Also

sidfex.plot.speedangle, sidfex.plot.speedangle2template

Examples

  # plot a template for speed-angle-plot in jpeg format
  sidfex.plot.speedangle.template(device = "jpeg")

helgegoessling/SIDFEx documentation built on March 15, 2024, 2:26 p.m.