graphPaper | R Documentation |
graphPaper
plots out traditional graph-paper axes for making
mathematical plots. Whereas standard R graphics put the axes at the
edge of the plotting window, graphPaper
puts them through the zeros
and lets you set explicitly the location of tick marks and graph-paper rules.
You can then plot over the axes by using functions such as lines
,
points
, or funPlot
(with add=TRUE
).
graph_paper( P = NULL, xticks = 0:5, yticks = xticks, show_labels = FALSE, no_axes = TRUE, xlabels = xticks, ylabels = yticks, extend = 0.1, xlim = c(min(xticks), max(xticks)), ylim = c(min(yticks), max(yticks)), xlab = "x", ylab = "y", maxxlabels = 7, maxylabels = 7, ... )
xticks |
numerical vector listing the position of x-axis ticks |
yticks |
like |
show_labels |
logical (default: FALSE) whether to place axis labels. |
no_axes |
logical (default: TRUE) Do not display the x and y axes |
xlabels |
as in |
ylabels |
similarly, set the y-axis label |
xlab |
Label for horizontal axis |
ylab |
Label for vertical axis |
a ggplot2 object
Daniel Kaplan (kaplan@macalester.edu)
graph_paper(xticks=-5:5, yticks=seq(-1, 1, by=.25), ylabels = c(-1, 1)) %>% graphFun(sin((x^2) / 3)~x, x=range(-4, 4), color="blue")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.