Display ggplot2 graphs from R to Jupyter

When I create a plot in Jupyter using the ggplot2 R package, I get a link to a chart that says "View PDF", and not the chart shown in the line.

I know that traditionally in IPython Notebook you were able to show inline diagrams using the magic %matplotlib function. Does Jupyter have something similar for R and ggplot2?

What do I need to do to show an inline graph versus a PDF link?

+7
r ggplot2 ipython-notebook jupyter
source share
2 answers

You can display graphs with this option.

 options(jupyter.plot_mimetypes = 'image/png') 

You can also create PDF files, as usual, in R, for example.

 pdf("test.pdf") ggplot(data.frame(a=rnorm(100,1,10)),aes(a))+geom_histogram() dev.off() 
+4
source share

There are currently some problems with producing ggplot2 outputs using IRkermel. There is an open GitHub question about this. The only workaround at the moment is to use PDF, jpg, png outputs for your stories.

+2
source share

All Articles