That works! I noticed already that I had to add the print command for seeing variables and summaries but I didn't know it would work with plots. Thank you very much.<br><br>Javier<br><br><div class="gmail_quote">On Fri, Dec 21, 2012 at 1:23 AM, Charlie Sharpsteen <span dir="ltr"><<a href="mailto:chuck@sharpsteen.net" target="_blank">chuck@sharpsteen.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="im"><div class="gmail_extra">On Thu, Dec 20, 2012 at 3:52 PM, Robert McGibbon <span dir="ltr"><<a href="mailto:rmcgibbo@gmail.com" target="_blank">rmcgibbo@gmail.com</a>></span> wrote:<br>
<div class="gmail_quote">

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>The IPython rmagic extension has built-in support for the base graphics system, but doesn't have corresponding support for ggplot.</div>


</blockquote></div></div></div><div class="gmail_extra"><br>(NOTE: Looks like Mailman may be eating my responses for some reason, so CCing those directly involved.)</div><div class="gmail_extra"><br></div><div class="gmail_extra">


All you need for "corresponding support" is to call `print()` on the output of grid graphics (such as ggplot2) when writing R code.</div><div class="gmail_extra"><br></div><div class="gmail_extra">The plotting functions in the base graphics system immediately paint results to the output device when the function is executed. In contrast, the plotting functions in the grid system return objects. This object-oriented nature is what makes ggplot2 work so well---complicated graphics can be built in an intuitive fashion because each function is returning objects that can be combined via overloaded addition operators. grid graphics aren't painted to the output device until the `print()` method is called on the object.</div>


<div class="gmail_extra"><br></div><div class="gmail_extra">The source of confusion is that the native R REPL (i.e. the thing that people play with when using the R GUI or the R command line interface) implicitly calls `print()` on the result of every computation. When running R programs outside of the official REPL, such as through RScript or in this case rpy2, the calls to `print()` must be explicitly added by the programmer in order to get code that works the same way.</div>


<div class="gmail_extra"><br></div><div class="gmail_extra">This is true for several R objects, but is especially noticeable with grid graphics.</div><span class="HOEnZb"><font color="#888888"><div class="gmail_extra"><br>
</div><div class="gmail_extra">

-Charlie</div></font></span></div>
</blockquote></div><br>