Learn R Programming

EGRET (version 2.3.0)

genericEGRETDotPlot: Generic EGRET plotting function

Description

Basic plotting framework for EGRET dot plots. Graphical parameters default to values that work well with most plots, but all can be re-assigned. See ?par for complete definitions of most optional input variables.

Usage

genericEGRETDotPlot(x, y, xlim, ylim, xTicks, yTicks, printTitle = TRUE,
  xaxs = "i", xlab = "", yaxs = "i", ylab = "", plotTitle = "",
  pch = 20, cex = 0.7, cex.main = 1.3, font.main = 2, cex.lab = 1.2,
  tcl = 0.5, cex.axis = 1, las = 1, xDate = FALSE, tinyPlot = FALSE,
  hLine = FALSE, oneToOneLine = FALSE, rmSciX = FALSE, rmSciY = FALSE,
  customPar = FALSE, col = "black", lwd = 1, showXLabels = TRUE,
  showYLabels = TRUE, showXAxis = TRUE, showYAxis = TRUE,
  removeFirstX = FALSE, removeLastX = FALSE, removeFirstY = FALSE,
  removeLastY = FALSE, ...)

Arguments

x
vector specifying the x data (required)
y
vector specifying the y data (required)
xlim
vector specifying the x plotting range (required)
ylim
vector specifying the y plotting range (required)
xTicks
vector specifying x axis tick placement (required)
yTicks
vector specifying y axis tick placement (required)
printTitle
logical defaults to TRUE, plotting parameter to control whether to have title
xaxs
character defaults to "i", defines the style of x-axis interval calculation. Possible values are i, r, e, s, d.
xlab
character defaults to "", defines the x label
yaxs
character defaults to "i", defines the style of y-axis interval calculation. Possible values are i, r, e, s, d.
ylab
character defaults to "", defines the y label
plotTitle
character defaults to "", defines the plot title
pch
number defaults to 20, specifies plot symbol
cex
number defaults to 0.7, specifies plotting text magnification
cex.main
number defaults to 1.3, specifies title text magnification
font.main
number defaults to 2, specifies which font to use for text
cex.lab
number defaults to 1.2 specifies label text magnification
tcl
number defaults to 0.5, specifies length of tick marks as fraction of height of a line of text.
cex.axis
number defaults to 1, specifies axis text magnification
las
number represents style of axis labels
xDate
logical defaults to FALSE, changes x label to "year-month" format if set to TRUE and total years less than 4.
tinyPlot
logical defaults to FALSE, if TRUE, changes defaults to be appropriate for multi-plot
hLine
logical defaults to FALSE, inserts horizontal line at zero
oneToOneLine
logical defaults to FALSE, inserts 1:1 line
rmSciX
logical defaults to FALSE, changes x label from scientific to fixed
rmSciY
logical defaults to FALSE, changes y label from scientific to fixed
customPar
logical defaults to FALSE. If TRUE, par() should be set by user before calling this function
col
color of points on plot, see ?par 'Color Specification'
lwd
number line width
showXLabels
logical defaults to TRUE. If FALSE, the x axis label is not plotted
showYLabels
logical defaults to TRUE. If FALSE, the y axis label is not plotted
showXAxis
logical defaults to TRUE. If FALSE, the x axis is not plotted
showYAxis
logical defaults to TRUE. If FALSE, the y axis is not plotted
removeFirstX
logical defaults to FALSE. If TRUE, removes the first x axis label. This can be handy for plotting mutliple plots.
removeLastX
logical defaults to FALSE. If TRUE, removes the last x axis label. This can be handy for plotting mutliple plots.
removeFirstY
logical defaults to FALSE. If TRUE, removes the first y axis label. This can be handy for plotting mutliple plots.
removeLastY
logical defaults to FALSE. If TRUE, removes the last y axis label. This can be handy for plotting mutliple plots.
...
additional graphical parameters can be adjusted

Examples

Run this code
eList <- Choptank_eList
Daily <- getDaily(eList)
x <- Daily$Date
y <- Daily$Q
xlim <- c(min(x),max(x))
ylim <- c(min(y),1.05*max(y))
xlab <- "Date"
ylab <- "Flow"
xTicks <- pretty(xlim)
yTicks <- pretty(ylim)
genericEGRETDotPlot(x=x, y=y,
                    xlim=xlim, ylim=ylim,
                    xlab=xlab, ylab=ylab,
                    xTicks=xTicks, yTicks=yTicks,
                    plotTitle="Test"
)

Run the code above in your browser using DataLab