View source: R/sidfex.plot.speedangle.on.template.R
sidfex.plot.speedangle.on.template | R Documentation |
Does mainly the same thing as sidfex.plot.speedangle
but uses an input file for the background axis and labels.
sidfex.plot.speedangle.on.template(index=NULL,read.fcst.res=NULL,read.obs.res=NULL,remap.res=NULL,
col.by="DaysLeadTime",colbar=sl.colbar.redgreyblue_256,
colbar.breaks=NULL,colbar.breaks.log=FALSE,points.type="p",out.device="pdf", in.device="png",
file=paste0("~/sidfex.plot.speedangle.",out.device),width=NULL,outer.plot=F
templatefile = NULL,...)
index |
a data frame specifying the SIDFEx forecasts to be read/analysed/plotted, or |
read.fcst.res |
a list with SIDFEx forecasts as returned by |
read.obs.res |
a list with SIDFEx observations as returned by |
remap.res |
a list with remapped SIDFEx observations as returned by |
col.by |
a character specifiying by what property data points shall be coloured. Can be either any column of |
colbar |
a spheRlab colourbar as returned by |
colbar.breaks |
an optional numeric vector specifying the breaks between colours. Ignored if |
colbar.breaks.log |
a logical value indicating whether breaks for the colourbar shall be placed in logarithmic steps. Default is |
points.type |
a character specifying whether only points ('p'), only lines ('l'), or both ('b') shall be plotted. |
in.device |
a character specifying the graphics device of the template ( |
out.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 output figure. The height will be equal. If |
outer.plot |
a boolean (default |
templatefile |
the image on which the data will be plotted. For best results use a png-file created by |
... |
Further graphical parameters to be forwarded to |
A list with the elements col.by
, colbar
, categorical
, breaks
, and labels
, which can be used to plot the corresponding colourbar with sl.plot.colbar
.
So far (and very certainly it will stay like this) only 'png' and 'jpeg' are intended and implemented as template types (in.device
). We recommend the usage of 'png', as 'jpeg' could lead to data points covering the labels, which can be solved by using transparend templates - a feature, that 'png' easily can provide. Aside from this limitation, the output files can be any supported graphics device.
As this function is almost identical with sidfex.plot.speedangle
now, the authors will soon discuss the necessity of keeping both.
Simon Reifenberg, Helge Goessling
sidfex.plot.speedangle.template
, sidfex.plot.speedangle
# load whole SIDFEx forecast index
index = sidfex.load.index()
# extract subindex with all forecasts that match some filters
subindex = index[ index$TargetID == "300234063991680" &
index$GroupID
index$InitYear == 2018 &
index$InitDayOfYear > 210 &
index$InitDayOfYear < 215, ]
# create the template
fn_template = "~/speedangle.template.png"
sidfex.plot.speedangle.template(device = "png", file = fn_template, width = 700)
# generate a speed-angle-plot for all forecast data corresponding to the subindex, with colours according to the GroupID
cb = sidfex.plot.speedangle.on.template(subindex,col.by="GroupID",points.type="p",colbar=sl.colbar(cols = c("violet","blue","green","yellow","orange","red"),N=256),
out.device="png",file="~/speedangle_example_plot2template.png",
templatefile = fn_template, width = 800)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.