<div dir="ltr"><div>Well, just realized that doing binding.pry will put me in pry and my plot is still live.  So, this solves the problem.</div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Aug 1, 2018 at 11:11 PM Rodrigo Botafogo &lt;<a href="mailto:rodrigo.a.botafogo@gmail.com">rodrigo.a.botafogo@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>So, I added awt() and the print command.  The plots shows up and then when the scrip ends it disappears.  Is there a way of running polyglot inside pry, so that the script does not end and plotting works?  Or do I need to write a loop to prevent the script from ending?  Pry would certainly be best.</div><div><br></div><div>Thanks<br></div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Aug 1, 2018 at 4:00 PM &lt;<a href="mailto:graalvm-users-request@oss.oracle.com" target="_blank">graalvm-users-request@oss.oracle.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Send GraalVM-Users mailing list submissions to<br>
        <a href="mailto:graalvm-users@oss.oracle.com" target="_blank">graalvm-users@oss.oracle.com</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
        <a href="https://oss.oracle.com/mailman/listinfo/graalvm-users" rel="noreferrer" target="_blank">https://oss.oracle.com/mailman/listinfo/graalvm-users</a><br>
or, via email, send a message with subject or body &#39;help&#39; to<br>
        <a href="mailto:graalvm-users-request@oss.oracle.com" target="_blank">graalvm-users-request@oss.oracle.com</a><br>
<br>
You can reach the person managing the list at<br>
        <a href="mailto:graalvm-users-owner@oss.oracle.com" target="_blank">graalvm-users-owner@oss.oracle.com</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than &quot;Re: Contents of GraalVM-Users digest...&quot;<br>
<br>
<br>
Today&#39;s Topics:<br>
<br>
   1. Running ggplot2 from Interop (Rodrigo Botafogo)<br>
   2. Re: Running ggplot2 from Interop (Roland Schatz)<br>
   3. Re: Running ggplot2 from Interop (Stepan)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Wed, 1 Aug 2018 09:56:04 -0300<br>
From: Rodrigo Botafogo &lt;<a href="mailto:rodrigo.a.botafogo@gmail.com" target="_blank">rodrigo.a.botafogo@gmail.com</a>&gt;<br>
Subject: [graalvm-users] Running ggplot2 from Interop<br>
To: <a href="mailto:graalvm-users@oss.oracle.com" target="_blank">graalvm-users@oss.oracle.com</a><br>
Message-ID:<br>
        &lt;CAAKc=GCgK2L66YY0hu=<a href="mailto:GDQnJozRH6XCywyeNV8N9FB52qP-FSg@mail.gmail.com" target="_blank">GDQnJozRH6XCywyeNV8N9FB52qP-FSg@mail.gmail.com</a>&gt;<br>
Content-Type: text/plain; charset=&quot;utf-8&quot;<br>
<br>
Hello...<br>
<br>
ggplot works fine in FastR, but if I try:<br>
<br>
Polyglot.eval(&quot;R&quot;, &lt;&lt;-R)<br>
  library(&#39;ggplot2&#39;)<br>
  ggplot(mtcars, aes(x=wt, y=mpg)) + geom_point()<br>
R<br>
<br>
nothing happens... the code executes and exits, but no graphics.  How<br>
should this be done?<br>
<br>
<br>
<br>
-- <br>
Rodrigo Botafogo<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <a href="http://oss.oracle.com/pipermail/graalvm-users/attachments/20180801/a720e97b/attachment-0001.html" rel="noreferrer" target="_blank">http://oss.oracle.com/pipermail/graalvm-users/attachments/20180801/a720e97b/attachment-0001.html</a> <br>
<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Wed, 1 Aug 2018 16:01:08 +0200<br>
From: Roland Schatz &lt;<a href="mailto:roland.schatz@oracle.com" target="_blank">roland.schatz@oracle.com</a>&gt;<br>
Subject: Re: [graalvm-users] Running ggplot2 from Interop<br>
To: <a href="mailto:graalvm-users@oss.oracle.com" target="_blank">graalvm-users@oss.oracle.com</a><br>
Message-ID: &lt;<a href="mailto:e27b81fb-64e9-6f1b-9fee-d5aef33babd7@oracle.com" target="_blank">e27b81fb-64e9-6f1b-9fee-d5aef33babd7@oracle.com</a>&gt;<br>
Content-Type: text/plain; charset=&quot;utf-8&quot;<br>
<br>
I stumbled over this as well in the past:<br>
<br>
When you run R code via `Polyglot.eval`, you&#39;re in non-interactive mode <br>
(similar to the `Rscript` command), so the output device defaults to svg <br>
(I think).<br>
Just add an &quot;awt()&quot; call to your script, and it should work.<br>
<br>
- Roland<br>
<br>
On 08/01/2018 02:56 PM, Rodrigo Botafogo wrote:<br>
&gt; Hello...<br>
&gt;<br>
&gt; ggplot works fine in FastR, but if I try:<br>
&gt;<br>
&gt; Polyglot.eval(&quot;R&quot;, &lt;&lt;-R)<br>
&gt; ? library(&#39;ggplot2&#39;)<br>
&gt; ? ggplot(mtcars, aes(x=wt, y=mpg)) + geom_point()<br>
&gt; R<br>
&gt;<br>
&gt; nothing happens... the code executes and exits, but no graphics.? How <br>
&gt; should this be done?<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; -- <br>
&gt; Rodrigo Botafogo<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; GraalVM-Users mailing list<br>
&gt; <a href="mailto:GraalVM-Users@oss.oracle.com" target="_blank">GraalVM-Users@oss.oracle.com</a><br>
&gt; <a href="https://oss.oracle.com/mailman/listinfo/graalvm-users" rel="noreferrer" target="_blank">https://oss.oracle.com/mailman/listinfo/graalvm-users</a><br>
<br>
<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <a href="http://oss.oracle.com/pipermail/graalvm-users/attachments/20180801/a898f641/attachment-0001.html" rel="noreferrer" target="_blank">http://oss.oracle.com/pipermail/graalvm-users/attachments/20180801/a898f641/attachment-0001.html</a> <br>
<br>
------------------------------<br>
<br>
Message: 3<br>
Date: Wed, 1 Aug 2018 16:16:00 +0200<br>
From: Stepan &lt;<a href="mailto:stepan.sindelar@oracle.com" target="_blank">stepan.sindelar@oracle.com</a>&gt;<br>
Subject: Re: [graalvm-users] Running ggplot2 from Interop<br>
To: <a href="mailto:graalvm-users@oss.oracle.com" target="_blank">graalvm-users@oss.oracle.com</a><br>
Message-ID: &lt;<a href="mailto:8796d837-9ed5-2013-762e-699c3995d7f4@oracle.com" target="_blank">8796d837-9ed5-2013-762e-699c3995d7f4@oracle.com</a>&gt;<br>
Content-Type: text/plain; charset=utf-8; format=flowed<br>
<br>
Another thing is that ggplot2 plots must be printed to actually show <br>
them, so:<br>
<br>
print(ggplot(mtcars, aes(x=wt, y=mpg)) + geom_point())<br>
<br>
if you want to build the plot dynamically (not tested):<br>
<br>
g &lt;- ggplot(mtcars, aes(x=wt, y=mpg)<br>
g &lt;- g + geom_point()<br>
print(g)<br>
<br>
Stepan<br>
<br>
On 01/08/18 16:01, Roland Schatz wrote:<br>
&gt; I stumbled over this as well in the past:<br>
&gt; <br>
&gt; When you run R code via `Polyglot.eval`, you&#39;re in non-interactive mode <br>
&gt; (similar to the `Rscript` command), so the output device defaults to svg <br>
&gt; (I think).<br>
&gt; Just add an &quot;awt()&quot; call to your script, and it should work.<br>
&gt; <br>
&gt; - Roland<br>
&gt; <br>
&gt; On 08/01/2018 02:56 PM, Rodrigo Botafogo wrote:<br>
&gt;&gt; Hello...<br>
&gt;&gt;<br>
&gt;&gt; ggplot works fine in FastR, but if I try:<br>
&gt;&gt;<br>
&gt;&gt; Polyglot.eval(&quot;R&quot;, &lt;&lt;-R)<br>
&gt;&gt; ? library(&#39;ggplot2&#39;)<br>
&gt;&gt; ? ggplot(mtcars, aes(x=wt, y=mpg)) + geom_point()<br>
&gt;&gt; R<br>
&gt;&gt;<br>
&gt;&gt; nothing happens... the code executes and exits, but no graphics.? How <br>
&gt;&gt; should this be done?<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; -- <br>
&gt;&gt; Rodrigo Botafogo<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; GraalVM-Users mailing list<br>
&gt;&gt; <a href="mailto:GraalVM-Users@oss.oracle.com" target="_blank">GraalVM-Users@oss.oracle.com</a><br>
&gt;&gt; <a href="https://oss.oracle.com/mailman/listinfo/graalvm-users" rel="noreferrer" target="_blank">https://oss.oracle.com/mailman/listinfo/graalvm-users</a><br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; _______________________________________________<br>
&gt; GraalVM-Users mailing list<br>
&gt; <a href="mailto:GraalVM-Users@oss.oracle.com" target="_blank">GraalVM-Users@oss.oracle.com</a><br>
&gt; <a href="https://oss.oracle.com/mailman/listinfo/graalvm-users" rel="noreferrer" target="_blank">https://oss.oracle.com/mailman/listinfo/graalvm-users</a><br>
&gt; <br>
<br>
<br>
<br>
------------------------------<br>
<br>
_______________________________________________<br>
GraalVM-Users mailing list<br>
<a href="mailto:GraalVM-Users@oss.oracle.com" target="_blank">GraalVM-Users@oss.oracle.com</a><br>
<a href="https://oss.oracle.com/mailman/listinfo/graalvm-users" rel="noreferrer" target="_blank">https://oss.oracle.com/mailman/listinfo/graalvm-users</a><br>
<br>
End of GraalVM-Users Digest, Vol 5, Issue 1<br>
*******************************************<br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="m_5154771047414874416gmail_signature" data-smartmail="gmail_signature">Rodrigo Botafogo<br>Integrando TI ao seu negócio<br>21-3010-4802/11-3010-1802</div>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">Rodrigo Botafogo<br>Integrando TI ao seu negócio<br>21-3010-4802/11-3010-1802</div>