SCM

Forum: help

Monitor Forum | Start New Thread Start New Thread
RE: Visualizing and changing margins of subplots created using mfrow3d [ Reply ]
By: Duncan Murdoch on 2019-10-30 14:51
[forum:47101]
The mouse resizing bug is fixed in rgl 0.100.32.

RE: Visualizing and changing margins of subplots created using mfrow3d [ Reply ]
By: Duncan Murdoch on 2019-10-30 13:30
[forum:47099]
That's right, mfrow3d() doesn't set up any margins. (I notice one bug: attempting to resize any of the cells using the mouse appears to resize the last one rather than the selected one. I'll see if I can fix that.)

RE: Visualizing and changing margins of subplots created using mfrow3d [ Reply ]
By: Tim Schaefer on 2019-10-30 13:14
[forum:47098]
None of the options mention anything on settings margins. Here is an example:

library("rgl");
shapes <- list(Tetrahedron = tetrahedron3d(), Cube = cube3d(), Octahedron = octahedron3d(),
Icosahedron = icosahedron3d(), Dodecahedron = dodecahedron3d(),
Cuboctahedron = cuboctahedron3d())
col <- rainbow(6)
open3d()
mfrow3d(3, 2)
for (i in 1:6) {
next3d() # won't advance the first time, since it is empty
shade3d(shapes[[i]], col = col[i])
}
highlevel(integer()) # To trigger display as rglwidget

RE: Visualizing and changing margins of subplots created using mfrow3d [ Reply ]
By: Duncan Murdoch on 2019-10-28 16:01
[forum:47083]
See the help page for par3d() to find the allowable parameters. "mar" and "oma" are not supported.

Other than that, I can't offer you any help without a reproducible example.

Visualizing and changing margins of subplots created using mfrow3d [ Reply ]
By: Tim Schaefer on 2019-10-28 12:00
[forum:47082]

fsbrain_t4_fsavg.png (9) downloads
Dear rgl experts,

I have created a plot in rgl that consists of 4 subplots, using the mfrow3d function:

rgloptions=list("windowRect"=c(0,0,1200,1200));
rgl::open3d();
do.call(rgl::par3d, rgloptions);
Sys.sleep(1);
rgl::bg3d(background);
rgl::mfrow3d(2,2);

rgl::next3d();
// draw mesh 1 here

rgl::next3d();
// draw mesh 2 here
...


The output figure is attached.

As you can see, there is some whitespace between the 4 subfigures. I do not know whether it exists due to margins or due to the viewport (i.e., because the object does not fill the whole scene in the 4 subplots), or because of a combination of both.

I would like to
1) visualize the margins (if any)
2) if there are margins, I would like to reduce them.

What I tried so far:
I changed the rgloptions to this:

rgloptions=list("windowRect"=c(0,0,1200,1200), mar=c(0,0,0,0));

but there is no difference. When trying to pass an oma parameter like this:

rgloptions=list("windowRect"=c(0,0,1200,1200), mar=c(0,0,0,0), oma=c(0,0,0,0));

I get a warning that oma cannot be set.

I hope somebody can help. Thanks for your time,

Tim

Thanks to:
Vienna University of Economics and Business Powered By FusionForge