some annotation perspective

14 views
Skip to first unread message

baptiste auguie

unread,
Mar 31, 2009, 8:17:29 AM3/31/09
to ggp...@googlegroups.com
Dear all,

I spent some time yesterday tweaking a graph (sizes.png), but
eventually I had to do the finishing touch in illustrator
(sizes-groups.png). I can see nothing very special about the
annotations, but at the moment this would be an impossible task (for
me) using ggplot2 only. With raw grid, however, such a layout could be
possible. Lattice offers the advantage that you can directly access
the panel coordinates, and plot for example a panel.xyplot() alone in
whichever viewport you create. The books by Murrell and sarkar offer
some examples of interaction between lattice and grid, such as
creating a very weird looking legend next to the graph, or having an
arrow point from one viewport to the data in another.

Would it be doable to extend the level of interaction between Grid and
ggplot2 to cover such cases?

Thanks for any comments or suggestions,

baptiste

--

_____________________________

Baptiste Auguié

School of Physics
University of Exeter
Stocker Road,
Exeter, Devon,
EX4 4QL, UK

Phone: +44 1392 264187

http://newton.ex.ac.uk/research/emag
______________________________

sizes.png
sizes-groups.png

baptiste auguie

unread,
Mar 31, 2009, 9:38:29 AM3/31/09
to Mike Lawrence, ggp...@googlegroups.com
it is a discrete variable: I remember dearly fabricating 60 arrays
with 5 different values of the pitch :-)

thanks for your suggestion though, I've had a hard time making this
graph look half sensible so i welcome comments.

baptiste


On Tue, Mar 31, 2009 at 2:15 PM, Mike Lawrence <Mike.L...@dal.ca> wrote:
> Unfortunately I can't answer your question but I have a question for
> you: is there any reason you're using a discrete color scale to map
> what seems to be a continuous variable ("pitch")? The discrete scale
> makes the graph rather busy and I suspect it would be more easily
> interpretable with a continuous color scale.
> --
> Mike Lawrence
> Graduate Student
> Department of Psychology
> Dalhousie University
>
> Looking to arrange a meeting? Check my public calendar:
> http://tinyurl.com/mikes-public-calendar
>
> ~ Certainty is folly... I think. ~

hadley wickham

unread,
Mar 31, 2009, 9:55:49 AM3/31/09
to baptiste auguie, ggp...@googlegroups.com
On Tue, Mar 31, 2009 at 7:17 AM, baptiste auguie
<bapt...@googlemail.com> wrote:
> Dear all,
>
> I spent some time yesterday tweaking a graph (sizes.png), but
> eventually I had to do the finishing touch in illustrator
> (sizes-groups.png). I can see nothing very special about the
> annotations, but at the moment this would be an impossible task (for
> me) using ggplot2 only. With raw grid, however, such a layout could be
> possible. Lattice offers the advantage that you can directly access
> the panel coordinates, and plot for example a panel.xyplot() alone in
> whichever viewport you create. The books by Murrell and sarkar offer
> some examples of interaction between lattice and grid, such as
> creating a very weird looking legend next to the graph, or having an
> arrow point from one viewport to the data in another.
>
> Would it be doable to extend the level of interaction between Grid and
> ggplot2 to cover such cases?

Well it's possible now - you just have to look at grid.ls and figure
out which viewport is which ;) Once I've rewritten the layout system
you should be able to get much better control over the individual
pieces. From an annotation perspective, the main complication is that
ggplot2 performs all the scale conversions, not grid, so that there is
no native scale in the panels, and I've yet to figure out a way around
this.

Hadley

--
http://had.co.nz/

baptiste auguie

unread,
Mar 31, 2009, 9:57:25 AM3/31/09
to Mike Lawrence, ggp...@googlegroups.com
fair point -- i will consider this

thanks!

baptiste

On Tue, Mar 31, 2009 at 2:52 PM, Mike Lawrence <Mike.L...@dal.ca> wrote:
> While you manipulated that variable discretely, is it not the case
> that there is a meaningful magnitude of difference between the
> discrete values? That is, the difference in pitch between 480 and 500
> is half the difference between 480 and 520. So, even though you didn't
> randomly sample the pitch space, I think it still makes sense to use a
> continuous color scale where 480 and 560 are two different colors and
> the intermediate values are appropriate blends of these colors.
>
> On Tue, Mar 31, 2009 at 10:38 AM, baptiste auguie

baptiste auguie

unread,
Mar 31, 2009, 12:40:05 PM3/31/09
to hadley wickham, ggp...@googlegroups.com

Great, I can't wait to see these changes in use (i'm guessing it'll
take a lot of examples).

What would be lovely is a plot method for grid.ls() that creates a
graphical summary of the grid objects and viewports (each tree with a
given colour, say, and each object with a small text label attached to
it, and/or an SVG tooltip).

Thanks,

baptiste

hadley wickham

unread,
Mar 31, 2009, 12:42:44 PM3/31/09
to baptiste auguie, ggp...@googlegroups.com
> Great, I can't wait to see these changes in use (i'm guessing it'll
> take a lot of examples).
>
> What would be lovely is a plot method for grid.ls() that creates a
> graphical summary of the grid objects and viewports (each tree with a
> given colour, say, and each object with a small text label attached to
> it, and/or an SVG tooltip).

Me too! Sounds like a great project ;)

Hadley

--
http://had.co.nz/

Reply all
Reply to author
Forward
0 new messages