[IPython-dev] ipython notebook and ggplot2

Robert McGibbon rmcgibbo at gmail.com
Thu Dec 20 13:29:57 EST 2012


The trick is that in the rmagic code, it calls dev.off() and does some handling for base graphics after every R code cell is executed.

When I use ggplot2 in the terminal app (not notebook), what I do is call 

ggsave('temp.png'); system('open temp.png') 

At the end of my plotting session. This pops up the plot in my image editor.

For the notebook, I think it's a little more complicated because you have to send the png to the front end through the display pub. 

Sent from my iPhone

On Dec 20, 2012, at 5:13 AM, Javier Martínez-López <javi.martinez.lopez at gmail.com> wrote:

> Dear all,
> 
> I am sorry if this is a particular question but I am working with R using the ipython notebook and I cannot plot grahps using the ggplot2 library. I do not know why, when I run the code nothing comes up! The same code works fine using the usual R interface and all other non ggplot2 graphs work fine under the nb. Of course, I previously loaded the ggplot2 library before plotting. Is there a trick, does anyone knows anything about this?
> 
> Thank you very much for your help,
> 
> Javier
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev



More information about the IPython-dev mailing list