View source: R/sidfex.plot.speedangle.template.R
sidfex.plot.speedangle.template | R Documentation |
This function creates an empty speed-angle-plot in a specified format ("device"), i.e. a template for adding lines or point clusters later.
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,...)
device |
a character specifying which graphics device to use, or |
file |
a character specifying the output file (if |
width |
a scalar specifying the width of the resulting figure. The height will be equal. If |
labels |
a logical value specifying whether or not labels shall be plotted. Default is |
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 |
The function returns nothing but saves the template to the specified destination.
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.
Simon Reifenberg
sidfex.plot.speedangle
, sidfex.plot.speedangle2template
# plot a template for speed-angle-plot in jpeg format
sidfex.plot.speedangle.template(device = "jpeg")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.