On Mon, Oct 26, 2015 at 7:39 AM, kcrisman <kcris...@gmail.com> wrote:
>>
>>
>> I wish to be able to plot in Octave/R inside a sagecell.
>> Therefore, I just set up a sagecell server using the instructions here
>> https://github.com/sagemath/sagecell
>>
>>
>> I compiled my own sagecell server because when you use
>> https://sagecell.sagemath.org
>> you get the following when trying to plot in R:
>> "Error in png() : X11 is not available"
>>
>> https://sagecell.sagemath.org/?z=eJwryMkv0UjWMNRRMNZRMNNRMNFRsNTUBABEDAT8&lang=r
>> and in Octave you only get a Ascii plot
>> https://sagecell.sagemath.org/?z=eJwryMkv0Yg21DGM1QQAFu8DVw==&lang=octave
>>
>> Using my own server plotting in R gives me nothing
>> (not even "Error in png() : X11 is not available")
>> and Octave still gives me only Ascii.
>>
>> I have two related questions:
>> 1. Is it possible to get R plots in sagecell?
>>
>
> It should be.   http://www.dan-erik.com/phdblog/2013/05/using-sage-with-r/
> might be helpful.
>
> But http://statisfactions.com/2013/interactive-r-code-widget/ used to work
> and doesn't any more, so that doesn't bode well.  Andrey, did you maybe use
> a version of Sage compiled without png support for R?  Unfortunately even
> the comment on that page no longer works.
>
> The graphics work with
> pdf("Figname.pdf")
> plot(...)
> dev.off()

Requiring the user to actually do that is a disaster regarding
usability.  In SageMathCloud I just make it automatic.  E.g.,doing
this just works:

%r
cars <- c(1, 3, 6, 4, 9)
plot(cars, type="o", col="blue")
title(main="Autos", col.main="red", font.main=4)

See:

  
https://cloud.sagemath.com/projects/4a5f0542-5873-4eed-a85c-a18c706e8bcd/files/support/2015-10-26-092322-r-plot.sagews

I don't think I've done the analogous thing for Octave yet, but should.

The way it works is by making %r  *slower* when used interactively, by
having it check to see if a new graphic was created each time it runs,
and if so, displaying it.   The codes all open source. Sage Cell
server should be changed to do the same, in my opinion.  However,
leave the sage library's r.eval itself alone, since doing the above
would slow it down.

William


-- 
William (http://wstein.org)

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to