[graalvm-users] GraalVM-Users Digest, Vol 5, Issue 1

Rodrigo Botafogo rodrigo.a.botafogo at gmail.com
Wed Aug 1 19:43:01 PDT 2018


Well, just realized that doing binding.pry will put me in pry and my plot
is still live.  So, this solves the problem.



On Wed, Aug 1, 2018 at 11:11 PM Rodrigo Botafogo <
rodrigo.a.botafogo at gmail.com> wrote:

> 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.
>
> Thanks
>
> On Wed, Aug 1, 2018 at 4:00 PM <graalvm-users-request at oss.oracle.com>
> wrote:
>
>> Send GraalVM-Users mailing list submissions to
>>         graalvm-users at oss.oracle.com
>>
>> To subscribe or unsubscribe via the World Wide Web, visit
>>         https://oss.oracle.com/mailman/listinfo/graalvm-users
>> or, via email, send a message with subject or body 'help' to
>>         graalvm-users-request at oss.oracle.com
>>
>> You can reach the person managing the list at
>>         graalvm-users-owner at oss.oracle.com
>>
>> When replying, please edit your Subject line so it is more specific
>> than "Re: Contents of GraalVM-Users digest..."
>>
>>
>> Today's Topics:
>>
>>    1. Running ggplot2 from Interop (Rodrigo Botafogo)
>>    2. Re: Running ggplot2 from Interop (Roland Schatz)
>>    3. Re: Running ggplot2 from Interop (Stepan)
>>
>>
>> ----------------------------------------------------------------------
>>
>> Message: 1
>> Date: Wed, 1 Aug 2018 09:56:04 -0300
>> From: Rodrigo Botafogo <rodrigo.a.botafogo at gmail.com>
>> Subject: [graalvm-users] Running ggplot2 from Interop
>> To: graalvm-users at oss.oracle.com
>> Message-ID:
>>         <CAAKc=GCgK2L66YY0hu=
>> GDQnJozRH6XCywyeNV8N9FB52qP-FSg at mail.gmail.com>
>> Content-Type: text/plain; charset="utf-8"
>>
>> Hello...
>>
>> ggplot works fine in FastR, but if I try:
>>
>> Polyglot.eval("R", <<-R)
>>   library('ggplot2')
>>   ggplot(mtcars, aes(x=wt, y=mpg)) + geom_point()
>> R
>>
>> nothing happens... the code executes and exits, but no graphics.  How
>> should this be done?
>>
>>
>>
>> --
>> Rodrigo Botafogo
>> -------------- next part --------------
>> An HTML attachment was scrubbed...
>> URL:
>> http://oss.oracle.com/pipermail/graalvm-users/attachments/20180801/a720e97b/attachment-0001.html
>>
>> ------------------------------
>>
>> Message: 2
>> Date: Wed, 1 Aug 2018 16:01:08 +0200
>> From: Roland Schatz <roland.schatz at oracle.com>
>> Subject: Re: [graalvm-users] Running ggplot2 from Interop
>> To: graalvm-users at oss.oracle.com
>> Message-ID: <e27b81fb-64e9-6f1b-9fee-d5aef33babd7 at oracle.com>
>> Content-Type: text/plain; charset="utf-8"
>>
>> I stumbled over this as well in the past:
>>
>> When you run R code via `Polyglot.eval`, you're in non-interactive mode
>> (similar to the `Rscript` command), so the output device defaults to svg
>> (I think).
>> Just add an "awt()" call to your script, and it should work.
>>
>> - Roland
>>
>> On 08/01/2018 02:56 PM, Rodrigo Botafogo wrote:
>> > Hello...
>> >
>> > ggplot works fine in FastR, but if I try:
>> >
>> > Polyglot.eval("R", <<-R)
>> > ? library('ggplot2')
>> > ? ggplot(mtcars, aes(x=wt, y=mpg)) + geom_point()
>> > R
>> >
>> > nothing happens... the code executes and exits, but no graphics.? How
>> > should this be done?
>> >
>> >
>> >
>> > --
>> > Rodrigo Botafogo
>> >
>> >
>> >
>> > _______________________________________________
>> > GraalVM-Users mailing list
>> > GraalVM-Users at oss.oracle.com
>> > https://oss.oracle.com/mailman/listinfo/graalvm-users
>>
>>
>> -------------- next part --------------
>> An HTML attachment was scrubbed...
>> URL:
>> http://oss.oracle.com/pipermail/graalvm-users/attachments/20180801/a898f641/attachment-0001.html
>>
>> ------------------------------
>>
>> Message: 3
>> Date: Wed, 1 Aug 2018 16:16:00 +0200
>> From: Stepan <stepan.sindelar at oracle.com>
>> Subject: Re: [graalvm-users] Running ggplot2 from Interop
>> To: graalvm-users at oss.oracle.com
>> Message-ID: <8796d837-9ed5-2013-762e-699c3995d7f4 at oracle.com>
>> Content-Type: text/plain; charset=utf-8; format=flowed
>>
>> Another thing is that ggplot2 plots must be printed to actually show
>> them, so:
>>
>> print(ggplot(mtcars, aes(x=wt, y=mpg)) + geom_point())
>>
>> if you want to build the plot dynamically (not tested):
>>
>> g <- ggplot(mtcars, aes(x=wt, y=mpg)
>> g <- g + geom_point()
>> print(g)
>>
>> Stepan
>>
>> On 01/08/18 16:01, Roland Schatz wrote:
>> > I stumbled over this as well in the past:
>> >
>> > When you run R code via `Polyglot.eval`, you're in non-interactive mode
>> > (similar to the `Rscript` command), so the output device defaults to
>> svg
>> > (I think).
>> > Just add an "awt()" call to your script, and it should work.
>> >
>> > - Roland
>> >
>> > On 08/01/2018 02:56 PM, Rodrigo Botafogo wrote:
>> >> Hello...
>> >>
>> >> ggplot works fine in FastR, but if I try:
>> >>
>> >> Polyglot.eval("R", <<-R)
>> >> ? library('ggplot2')
>> >> ? ggplot(mtcars, aes(x=wt, y=mpg)) + geom_point()
>> >> R
>> >>
>> >> nothing happens... the code executes and exits, but no graphics.? How
>> >> should this be done?
>> >>
>> >>
>> >>
>> >> --
>> >> Rodrigo Botafogo
>> >>
>> >>
>> >>
>> >> _______________________________________________
>> >> GraalVM-Users mailing list
>> >> GraalVM-Users at oss.oracle.com
>> >> https://oss.oracle.com/mailman/listinfo/graalvm-users
>> >
>> >
>> >
>> >
>> > _______________________________________________
>> > GraalVM-Users mailing list
>> > GraalVM-Users at oss.oracle.com
>> > https://oss.oracle.com/mailman/listinfo/graalvm-users
>> >
>>
>>
>>
>> ------------------------------
>>
>> _______________________________________________
>> GraalVM-Users mailing list
>> GraalVM-Users at oss.oracle.com
>> https://oss.oracle.com/mailman/listinfo/graalvm-users
>>
>> End of GraalVM-Users Digest, Vol 5, Issue 1
>> *******************************************
>>
>
>
> --
> Rodrigo Botafogo
> Integrando TI ao seu negócio
> 21-3010-4802/11-3010-1802
>


-- 
Rodrigo Botafogo
Integrando TI ao seu negócio
21-3010-4802/11-3010-1802
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://oss.oracle.com/pipermail/graalvm-users/attachments/20180801/7b2b840b/attachment-0001.html 


More information about the GraalVM-Users mailing list