<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 <<a href="mailto:rodrigo.a.botafogo@gmail.com">rodrigo.a.botafogo@gmail.com</a>> 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 <<a href="mailto:graalvm-users-request@oss.oracle.com" target="_blank">graalvm-users-request@oss.oracle.com</a>> 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 'help' 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 "Re: Contents of GraalVM-Users digest..."<br>
<br>
<br>
Today'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 <<a href="mailto:rodrigo.a.botafogo@gmail.com" target="_blank">rodrigo.a.botafogo@gmail.com</a>><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>
<CAAKc=GCgK2L66YY0hu=<a href="mailto:GDQnJozRH6XCywyeNV8N9FB52qP-FSg@mail.gmail.com" target="_blank">GDQnJozRH6XCywyeNV8N9FB52qP-FSg@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
Hello...<br>
<br>
ggplot works fine in FastR, but if I try:<br>
<br>
Polyglot.eval("R", <<-R)<br>
library('ggplot2')<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 <<a href="mailto:roland.schatz@oracle.com" target="_blank">roland.schatz@oracle.com</a>><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: <<a href="mailto:e27b81fb-64e9-6f1b-9fee-d5aef33babd7@oracle.com" target="_blank">e27b81fb-64e9-6f1b-9fee-d5aef33babd7@oracle.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
I stumbled over this as well in the past:<br>
<br>
When you run R code via `Polyglot.eval`, you'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 "awt()" call to your script, and it should work.<br>
<br>
- Roland<br>
<br>
On 08/01/2018 02:56 PM, Rodrigo Botafogo wrote:<br>
> Hello...<br>
><br>
> ggplot works fine in FastR, but if I try:<br>
><br>
> Polyglot.eval("R", <<-R)<br>
> ? library('ggplot2')<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>
><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>
<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 <<a href="mailto:stepan.sindelar@oracle.com" target="_blank">stepan.sindelar@oracle.com</a>><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: <<a href="mailto:8796d837-9ed5-2013-762e-699c3995d7f4@oracle.com" target="_blank">8796d837-9ed5-2013-762e-699c3995d7f4@oracle.com</a>><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 <- ggplot(mtcars, aes(x=wt, y=mpg)<br>
g <- g + geom_point()<br>
print(g)<br>
<br>
Stepan<br>
<br>
On 01/08/18 16:01, Roland Schatz wrote:<br>
> I stumbled over this as well in the past:<br>
> <br>
> When you run R code via `Polyglot.eval`, you'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 "awt()" call to your script, and it should work.<br>
> <br>
> - Roland<br>
> <br>
> On 08/01/2018 02:56 PM, Rodrigo Botafogo wrote:<br>
>> Hello...<br>
>><br>
>> ggplot works fine in FastR, but if I try:<br>
>><br>
>> Polyglot.eval("R", <<-R)<br>
>> ? library('ggplot2')<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>
>><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>
> <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>
<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>