plot size and rgl crash in JGR on Mac

55 views
Skip to first unread message

Vincent

unread,
Nov 5, 2012, 6:38:41 AM11/5/12
to ded...@googlegroups.com
In code I linked to a dialog I would like to specify the size of the output plot. I'm using the standar 'plot' function in R.

When I specify dev.new(width=7, height=7) I get the error 'Error in plot.new() : figure margins too large'. I have tried smaller numbers but get the same error. Should I use a different command within JGR/Deducer? This worked fine from the R-gui on Mac.

Perhaps relevant, when I type dev.new(width=7,height=7) in JGR a really tiny plot window opens.

> dev.new(width=7, height=7)
> plot(1:10)
Error in plot.new() : figure margins too large

I also included some code to make a 3D plot using RGL. Everything looks great from the R-gui on mac when I try running it through JGR/Deducer the sizing command (see below) is ignored and then I try to increase the size of the window JGR crashes (see attached). 

r3dDefaults$windowRect <- c(0,0, 1400, 1400)

Any suggestions?



jgr.rgl.crash.txt

Vincent

unread,
Nov 5, 2012, 6:49:54 AM11/5/12
to ded...@googlegroups.com
Interestingly the following works fine when I type it in the JGR command box (i.e., it starts at my desired size and I can resize as wanted).

library(rgl)
r3dDefaults$windowRect <- c(0,0, 1400, 1400)
plot3d(cbind(1:10,1:10,1:10))

However, when I put these lines in a function called through a Deducer dialog JGR crashes.

eagle.e...@gmail.com

unread,
Nov 5, 2012, 10:13:47 PM11/5/12
to ded...@googlegroups.com
After a lot more searching and trial and error I found some work-arounds:

rgl 3D plots works if I create a command string and use execute(). It doesn't work when I do a direct call to rgl from a function.

For regular plots in JGR you should (apparently) not use:

dev.new(width=10, height=10)

but rather:

JavaGD(name="", width=800, height=800, ps=12)
Reply all
Reply to author
Forward
0 new messages