Vincent Delecroix wrote: > Hi, > > I'm working on simple statistic example for which I use the SAGE > interface of the R program. I'm not able to plot a graphic. > > In R we use : > {{{ > R: x <- (1, 1, 1, 2, 3, 3, 4, 5, 5, 6) > R: hist(x) > }}} > > I try the following in SAGE (version 4.1) : > {{{ > sage: x = r("c(1, 1, 1, 2, 3, 3, 4, 5, 5, 6)") > sage: r.hist(x) > ... > }} > > The last command returns a strange objects, which does not plot > anything ! In the documentation string of the r.hist object, it is > asked to set a plot parameter to TRUE (in upper case, which is the R > syntax). I tried the following without success : > {{{ > sage: r.hist(x, plot=True) > ... > }}} > > Does anybody know how to use graphic functions from R ? >
You probably need to set up a graphics device. Try e.g r.png('testfile.png') # then plot # then: r.dev_off() Dag Sverre --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---