On Monday, 26 October 2015 10:27:23 UTC-6, William wrote:
>
> On Mon, Oct 26, 2015 at 7:39 AM, kcrisman <[email protected] <javascript:>> 
> 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) 
>

 
 Hi William,

Can you please give a pointer to where this is implemented in SMC? 

Somewhat related: one of the problems with cells is that R works from a 
wrong directory (home) and writes its files there. They should be instead 
in a proper temp folder where at least links to plots will be given.

Andrey

-- 
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 [email protected].
To post to this group, send email to [email protected].
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