Skip to content
Prev 809 / 1236 Next

[R-gui] embedding R graphics in Tk widgets

On Thu, 19 Jun 2008 02:14:18 +0000 (UTC),
jverzani <jverzani at gmail.com> wrote:
[...]
Thanks for the explanation!

On another note, I got a bit confused the other day trying to learn more
about layout from the density example given in the vignette.  I was
trying to get the following layout:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: density_layout.png
Type: image/png
Size: 6458 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-gui/attachments/20080703/74926396/attachment.png>
-------------- next part --------------

Basically, move the bandwidth slider below the graph and spanning the
whole width of the window.  Modifying the layout section of the code as:

---<---------------cut here---------------start-------------->---
window <- gwindow("gWidgetsDensity")
bigGroup <- ggroup(container=window)

vGroup <- ggroup(horizontal=FALSE, container=bigGroup)
hGroup <- ggroup(horizontal=FALSE, container=bigGroup)

tmp <- gframe("Distribution", container=vGroup)
add(tmp, distribution)

tmp  <- gframe("Sample size", container=vGroup)
add(tmp,sampleSize)

tmp <- gframe("Kernel", container=vGroup)
add(tmp,kernel)

add(bigGroup, ggraphics())

tmp <- gframe("Bandwidth adjust", container=hGroup)
add(tmp,bandwidthAdjust, expand=TRUE)
---<---------------cut here---------------end---------------->---

Why is the slider still packed side by side, when I'm specifying
'horizontal=FALSE' in hGroup?

I also notice that one needs to do something in a widget to produce the
initial plot, i.e. a default initial the plot is not produced.


Thanks for any further pointers,