plot-methods {RadOnc} | R Documentation |
Additional Methods for Function plot
in Package graphics
Description
These additional methods extend function plot
in package graphics, enabling DVH visualization in package RadOnc
Usage
## S3 method for class 'DVH'
plot(x, ..., plot.type = NULL)
## S3 method for class 'DVH.list'
plot(x, ..., plot.type = NULL)
Arguments
x |
Can represent either an object of class |
... |
May contain any number of objects of class |
plot.type |
A character string specifying the type of plot to generate, must be one of |
Details
See package vignette and examples (below) for more details about each plotting subtype.
Graphical Parameters
alpha
-
When
plot.type="ttest"
,"wilcox"
, or"correlation"
, this specifies the numerical value (threshold) used to display significant p-values. angle
-
The slope of shading lines, given as an angle in counter-clockwise degrees (default is
45
). This parameter is ignored ifdensity=NULL
orNA
or whereverfill=FALSE
or is ignored (e.g. whenplot.type="individual"
or"bars"
). Also note that this paramater can represent a list of different angles, with length of the list corresponding to the number ofDVH
orDVH.list
objects. back
-
A character value specifying the back-facing surface fill method when
x
is azDVH
object (the parameter is otherwise ignored). Value must be one of"filled"
,"lines"
,"points"
, or"culled"
. Default value is assigned from input parameterfront
. center
-
A character value specifying where to plot the center of a group when
plot.type="grouped"
(the parameter is otherwise ignored). Value must be one of"mean"
or"median"
. Note: As of package v.1.0.3, this parameter is considered defunct and will be disregarded accordingly. col
-
The color to be used for drawing lines. This parameter can also represent a list of different colors, with length corresponding to the number of
DVH
,zDVH
, orDVH.list
objects (ifplot.type="individual"
, number of colors should correspond to number of individualDVH
objects).When
plot.type="bars"
,col
instead represents a list of colors used to define the shading scheme applied to the entire dose range. Default color scheme is a standard rainbow, with colors ranging from"blue"
to"red"
. Actual default is specified asrev(rainbow(n=10, start=0, end=2/3))
. Seecolors
for more options and information. density
-
The density of shading lines, in lines per inch. The default value of
NULL
means that no shading lines are drawn. A zero value ofdensity
means no shading nor filling, whereas negative values andNA
suppress shading lines but allow solid color filling. Note that this paramater can also represent a list of different densities, with length of the list corresponding to the number ofDVH
orDVH.list
objects. fill
-
Logical, defaulting to
TRUE
. Determines whether or not to draw shading around groups of DVH lines. Note that this parameter is relevant whenplot.type="grouped"
,"ttest"
or"wilcox"
(it is ignored whenplot.type="individual"
or"bars"
). fill.lty
-
The line type used for shading (per
density
andangle
parameters). Seelty
above for further specifications of line types. Note that this paramater can represent a list of different line types, with length corresponding to the number ofDVH
orDVH.list
objects. fill.transparency
-
Factor modifying the transparency of filling/shading (value must be between
[0,1]
), withfill.transparency=0
specifying complete transparency and1
specifying complete opacity. Note that this parameter can represent a list of different transparency factors, with length corresponding to the number ofDVH
orDVH.list
objects. Default value isline.transparency/2
. front
-
A character value specifying the front-facing surface fill method when
x
is azDVH
object (the parameter is otherwise ignored). Value must be one of"filled"
(default),"lines"
,"points"
, or"culled"
. grid
-
Logical, defaulting to
FALSE
. Determines whether or not to draw gridlines on 2D plot. Note that this parameter is relevant whenplot.type="individual"
,"grouped"
,"ttest"
, or"wilcox"
(it is ignored whenplot.type="bars"
or when plottingzDVH
objects). highlight
-
The color to be used for shading p-value data when
plot.type="ttest"
or"wilcox"
. Seecolors
for more options and information. legend
-
Value specifying the location to draw a figure legend, must be one of
"topright"
,"bottomright"
,"bottom"
,"bottomleft"
,"left"
,"topleft"
,"top"
,"right"
, or"center"
. These keywords place the legend on the inside of the plot frame at the location specified. Partial argument matching is used. Iflegend=NA
(default), the legend is not drawn.When
plot.type="bars"
,legend
is interpreted instead as a logical value and must be eitherTRUE
(default) orFALSE
. IfTRUE
, labels are drawn at the bottom of the plot, outside of the actual plotting frame.Note that
legend
parameter is ignored whenplot.type="wilcox"
andpanel.lower="difference"
. legend.labels
-
A character or
expression
vector specifying the text to appear in the legend, when relevant. Length oflegend.labels
must match the numer ofDVH
andDVH.list
objects, otherwise legend text will default to the form:"Group 1", "Group 2", ...
line.transparency
-
Factor modifying the transparency of line drawings (value must be between
[0,1]
), withfill.transparency=0
specifying complete transparency and1
(default) specifying complete opacity. Note that this parameter can represent a list of different transparency factors, with length corresponding to the number ofDVH
orDVH.list
objects (ifplot.type="individual"
, number of transparency factors should correspond to number of individualDVH
objects). lty
-
The line type. Line types can either be specified as an integer (0=blank, 1=solid (default), 2=dashed, 3=dotted, 4=dotdash, 5=longdash, 6=twodash) or as one of the character strings
"blank"
,"solid"
,"dashed"
,"dotted"
,"dotdash"
,"longdash"
, or"twodash"
, where"blank"
uses 'invisible lines' (i.e., does not draw them).Alternatively, a string of up to 8 characters (from c(1:9, "A":"F")) may be given, giving the length of line segments which are alternatively drawn and skipped (see
par
for more details). Note that this paramater can also represent a list of different line types, with length corresponding to the number ofDVH
orDVH.list
objects (ifplot.type="individual"
, number of line types should correspond to number of individualDVH
objects). lwd
-
The line width, a emphpositive number, defaulting to
1
. The interpretation is device-specific, and some devices do not implement line widths less than one (see the help on the device for details of the interpretation). Note that this paramater can also represent a list of different line widths, with length of the list corresponding to the number ofDVH
orDVH.list
objects (ifplot.type="individual"
, number of line widths should correspond to number of individualDVH
objects). main
-
An overall title for the plot (see
title
, default is""
). multiplier
-
A single numerical value (default is
1
) specifying the degree to which group display width should be shrunken or magnified. This parameter is only processed whenplot.type="grouped"
or"ttest"
andwidth="mad"
,"sd"
, or"var"
. new
-
Logical, defaulting to
TRUE
. If set toFALSE
, the next high-level plotting command (actuallyplot.new
) should not clean the frame before drawing as if it were on a new device. It is an error (ignored with a warning) to try to usenew=FALSE
on a device that does not currently contain a high-level plot. panel.lower
-
Value specifying the lower panel plot content when
plot.type="wilcox"
(panel.lower
must be one of"grouped"
or"wilcox"
[default]). Partial argument matching is used. Whenpanel.lower="wilcox"
, the median groupwise differences will be displayed with associated confidence intervals obtained fromwilcox.test()
. Whenpanel.lower="grouped"
, the individual groups are displayed with surrounding user-specified intervals (seewidth
,quantile
, andmultiplier
parameters). quantile
-
A numeric vector containing two values in [0,1] (default is the interquartile range:
(0.25, 0.75)
), specifying the lower and upper probabilities (respectively) to be used whenwidth="quantile"
andplot.type="grouped"
or"ttest"
. Seequantile
for more details. width
-
A character vector specifying the width of shading to use, when relevant (for a group of DVHs). Value must be one of
"range"
(default),"mad"
,"IQR"
,"quantile"
,"var"
, or"sd"
, specifying the absolute range, the mean-absolute-deviation, the interquartile (25-75%) range, the arbitrary inter-quantile range (seequantile
parameter), the group variance, or standard deviation, respectively. This parameter is ignored unlessplot.type="grouped"
. Ifplot.type="ttest"
, the parameter can be optionally specified (ifwidth=NULL
(default), shading will default to the confidence interval). xlim
-
A numeric vector of length 2 specifying the minimum and maximum x coordinates for plotting (note that this parameter is ignored when
plot.type="bars"
,new=FALSE
, or plotting object(s) of classzDVH
). ylim
-
A numeric vector of length 2 specifying the minimum and maximum y coordinates for plotting (note that this parameter is ignored when
plot.type="bars"
,new=FALSE
, or plotting object(s) of classzDVH
).
Additional Parameters
alternative
-
When
plot.type="ttest"
,"wilcox"
, or"correlation"
,alternative
indicates the alternative hypothesis and must be one of"two.sided"
,"greater"
or"less"
. You can specify just the initial letter."greater"
corresponds to positive association,"less"
to negative association. Seecor.test
for more details. dose
-
Value specifying dose scale (must be one of
"relative"
or"absolute"
). dose.units
-
Value specifying dose units (must be one of
"cGy"
or"Gy"
). exact
-
When
plot.type="wilcox"
orplot.type="correlation"
andmethod="kendall"
or"spearman"
,exact
specifies a logical indicating whether an exact p-value should be computed. Seecor.test
orwilcox.test
for more details. method
-
When
plot.type="correlation"
,method
specifies a character string indicating which correlation coefficient is to be computed. Value must be one of"pearson"
(default),"kendall"
, or"spearman"
. Seecor.test
for more details. mu
-
When
plot.type="ttest"
or"wilcox"
, specifies an optional parameter used to form the null hypothesis. Seet.test
orwilcox.test
for more details. paired
-
A logical value (default is
FALSE
) specifying whether or not to perform paired groupwise comparisons whenplot.type="ttest"
or"wilcox"
. type
-
Value specifying type of dose-volume histogram to plot (must be one of
"cumulative"
or"differential"
). volume
-
Value specifying volume scale (must be one of
"relative"
or"absolute"
).
See Also
Examples
# plot(x, ..., plot.type="individual")
OARs <- c("LIVER","STOMACH","DUODENUM")
cols <- c("red", "darkgreen", "blue")
plot(johndoe[OARs], col=cols, lty=1:3, legend="topright", legend.labels=OARs, main="OARs")
# plot(x, ..., plot.type="bars")
plot(janedoe[2:9], plot.type="bars", volume="absolute",dose="relative")
# plot(x, ..., plot.type="grouped")
plot(c(johndoe["STOMACH"],janedoe["STOMACH"]), #group 1
c(johndoe[c("CTV","PTV")],janedoe[c("CTV","PTV")]), #group 2
c(janedoe["LIVER"],johndoe["LIVER"]), #group 3
c(johndoe["DUODENUM"],janedoe["DUODENUM"]), #group 4
plot.type="grouped", col=c("orange","green","blue","red"), lwd=2, dose="relative")
# plot(x, ..., plot.type="ttest")
# OARs <- c("LIVER", "STOMACH", "SMALL_BOWEL")
# plot(c(johndoe[c("CTV","PTV")],janedoe[c("CTV","PTV")]), #group 1
# c(janedoe[OARs],johndoe[OARs]), #group 2
# plot.type="t", col=c("red", "blue"), lty=2, fill.lty=1, main="Target v. OAR t-Test")
# plot(x, ..., plot.type="wilcox")
# plot(c(johndoe[c("CTV","PTV")],janedoe[c("CTV","PTV")]), #group 1
# c(janedoe[OARs],johndoe[OARs]), #group 2
# plot.type="w", col=c("red", "blue"), lty=2, fill.lty=1, main="Target v. OAR",
# panel.lower="grouped")
# plot(x, ..., plot.type="correlation")
# plot(janedoe, sample(1:100, 10), plot.type="correlation", method="kendall")