| Hosted by CoCalc | Download
Kernel: R (R-Project)
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)
Image in a Jupyter notebook
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)
Image in a Jupyter notebook
# 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")))
Image in a Jupyter notebook