Ask Your Question
2

R graphics/plots in sagenb

asked 2011-09-14 22:43:13 +0100

riotQontrol gravatar image

Are graphics in R on sagenb supported? I only get placeholder icons for output.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2011-09-14 23:16:13 +0100

kcrisman gravatar image

updated 2013-10-16 19:44:56 +0100

Short answer: yes, they are.

Long answer: it depends on the precise platform and how your R was compiled, what was on it.

  • On Mac, they should "just work", though I've heard rumors it is not always true.
  • On Linux, there are various packages you may need, and once in a while a binary is uploaded which was not compiled with them. One resource might be this ask.sagemath.org question. This ticket may also be of use.
  • On the xyz.sagenb.org machines, you should be ok. I've used R graphics on them many times.

Edit: Turns out that the poster actually just needed to create a graphics device and turn it off - see this documentation, where this is implicit. Hope this helps someone!

edit flag offensive delete link more

Comments

I got the same problem. I just followed: http://ask.sagemath.org/question/192/compiling-r-with-png-support installed all the libraries, compiled the R and r.eval('capabilities("png")') returns true, and r.eval('capabilities("X11")') returns False. When I plot something in R, I get a broken icon (I am running Sage 5.9 via ssh from a remote server).

José Luis gravatar imageJosé Luis ( 2013-09-20 04:09:45 +0100 )edit
1

I got it working. Just adding r.png() at the begining and r.dev_off() at the end of the cell.

José Luis gravatar imageJosé Luis ( 2013-10-16 12:49:48 +0100 )edit

Hah! I'm sorry, I'll add this to the answer - this is in fact in the Sage documentation, so I was thinking something much more complicated.

kcrisman gravatar imagekcrisman ( 2013-10-16 19:41:51 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2011-09-14 22:43:13 +0100

Seen: 774 times

Last updated: Oct 16 '13