Sharedsupport / 2016-11-24-r-graph.ipynbOpen in CoCalc
Author: William A. Stein
License: GNU General Public License v3.0
Description: Examples for support purposes.
In [2]:
options(jupyter.plot_mimetypes = "image/png") # Define the cars vector with 5 values cars <- c(1, 3, 6, 4, 9) # Graph the cars vector with all defaults plot(cars)
In [3]:
options(jupyter.plot_mimetypes = "image/svg+xml") # Define the cars vector with 5 values cars <- c(1, 3, 6, 4, 9) # Graph the cars vector with all defaults plot(cars)
In [5]:
# Create a plot with some normally distributed data library("ggplot2") set.seed(42) n <- 1000 p <- ggplot(data.frame(x = rnorm(n), y = rnorm(n)), aes(x=x, y=y)) + geom_point(alpha = 0.25, size = 1, colour = "blue") + geom_density2d(colour = "red") p + ggtitle(sprintf("Mime type = '%s'", getOption("jupyter.plot_mimetypes")))
In [ ]: