View source: R/datalow_utils.r
plot1 | R Documentation |
plot1 provides a quick way to plot out a single xy line plot. It can be used with plotprep to generate a plot outside of Rstudio or by itself to generate one within Rstudio. It uses a standard par setup and permits custom labels, font, and font size (cex). It checks the spread of y and if a ymax is not given in the parameters finds the ymax and checks to see if y goes negative in which case it uses getmin, so the y-axis is set to 0 - ymax or ymin - ymax
plot1(
x,
y,
xlabel = "",
ylabel = "",
type = "l",
usefont = 7,
cex = 0.85,
maxy = 0,
defpar = TRUE,
inpch = 16,
incol = 1
)
x |
The single vector of x data |
y |
the single vector of y data. If more are required they can be added spearately after calling plot1. |
xlabel |
the label fot the x-axis, defaults to empty |
ylabel |
the label fot the y-axis, defaults to empty |
type |
the type of plot "l" is for line, the default, "p" is points. If you want both plot a line and add points afterwards. |
usefont |
which font to use, defaults to 7 which is Times bold |
cex |
the size of the fonts used. defaults to 0.85 |
maxy |
defaults to 0, which does nothing. If a value is given then this value is used rather than estimating from the input y |
defpar |
if TRUE then plot1 will declare a par statement. If false it will expect one outside the function. In this way plot1 can be used when plotting multiple graphs, perhaps as mfrow=c(2,2) |
inpch |
the input character type if using type="p", default=16 |
incol |
the colour to use for the line or points, default = black |
nothing but it does plot a graph and changes the par setting
## Not run:
x <- rnorm(20,mean=5,sd=1)
plot1(x,x,xlabel="x-values",ylabel="yvalues")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.