Proposed final version of transition document

520 views
Skip to first unread message

Dennis Murphy

unread,
Feb 10, 2012, 9:07:06 PM2/10/12
to ggplot2-dev
Hi:

Since I've gotten few complaints or suggestions for new material from
the last version of this document (knock wood), I'm proposing this as
the final version subject to approval by list members.

I did make an addition in the section on continuous scales in response
to a couple of recent inquiries about defining one's own scales (see
the bottom half of p. 31 to the top of p. 33), so please check that
out and let me know if you think it can be improved.

Hadley mentioned wanting to post this to the regular ggplot2 group
sometime next week, so if you want to comment on it, I'd prefer that
you do so before the weekend is out. Is there someplace we can host
the color and B/W versions when it's finalized - the ggplot2 wiki,
perhaps?

Thanks to everyone who commented on earlier versions and improved the
(nearly) final product.

Dennis

guide-color.pdf
guide-bw.pdf

baptiste auguie

unread,
Feb 11, 2012, 5:13:30 AM2/11/12
to Dennis Murphy, ggplot2-dev
Hi,

I'm not sure if it's useful to mention them in this document, but I
believe v. 0.90 introduced

annotation_custom
annotation_map
annotation_raster

Thanks for the very useful reference,

b.

baptiste auguie

unread,
Feb 11, 2012, 5:42:33 PM2/11/12
to Dennis Murphy, ggplot2-dev
Maybe one example combining the three,


library(ggplot2)

p <- qplot(mpg, wt, data = mtcars) + theme_bw()

## color gradient
rainbow <- matrix(hcl(seq(0, 360, length = 300 * 50), 80, 70), ncol = 300)

## scaled down map of NZ
library(maps)
nz <- transform(map_data("nz"), long = scale(long) + 15,
lat = scale(lat)/5 + 2)

# Inset plot
g <- ggplotGrob(p)

p +
annotation_raster(rainbow, -Inf, Inf, -Inf, Inf) +
geom_point() +
annotation_map(nz, fill = "NA", colour = "grey50") +
annotation_custom(grob = g, xmin = 25, xmax = 35, ymin = 3.5, ymax = 5)


Cheers,

b.

On 11 February 2012 23:13, baptiste auguie

Dennis Murphy

unread,
Feb 11, 2012, 6:30:39 PM2/11/12
to baptiste auguie, ggplot2-dev
Hi Baptiste:

Sa-weeeeeeeeeeettt! That's a keeper! :)

Thanks,
Dennis

baptiste auguie

unread,
Feb 11, 2012, 8:07:41 PM2/11/12
to Dennis Murphy, ggplot2-dev
Thinking about it, rainbow, which I took from ?annotate_raster doesn't
need 50 rows, one is enough:

rainbow <- t(hcl(seq(0, 360, length = 300), 80, 70))

Cheers,

b.

Brandon Hurr

unread,
Feb 13, 2012, 3:18:34 AM2/13/12
to Dennis Murphy, ggplot2-dev

Dennis, 

I didn't make it all the way through it yet, but I did find one coding issue... 

Page 3: 

Usersnolongerhavetoworryaboutthevariablename/aestheticnamebugletthatplagued earlier versions, which was a particular problem when a faceting variable was the name of an aesthetic (e.g., colour or size). You can now expect that code like the following will work: «code0,eval=FALSE»= ggplot(df, aes(x, y, group = group, colour = color))

Dennis Murphy

unread,
Feb 13, 2012, 3:41:41 AM2/13/12
to Brandon Hurr, ggplot2-dev
Thanks for catching this, Brandon. The problem was that the code chunk
was indented rather than starting and ending in column 1. Dumb mistake
on my part - I keep a note to that effect in my Sweave templates so I
don't forget, but I'm using knitr this time. Guess I need to put it
there for knitr templates, too...

Best,
Dennis

joran

unread,
Mar 2, 2012, 5:50:08 PM3/2/12
to ggplo...@googlegroups.com
I don't see a way to have the github wiki host the pdf itself. If that isn't possible, could Hadley host it on his ggplot2 website? I'm anticipating wanting to link to it as a reference with some regularity on StackOverflow. I can always points folks toward this forum, but it would be nice to have a more permanent feeling location.

Or has a location for it been decided upon and I just missed it...?

- Joran

baptiste auguie

unread,
Mar 2, 2012, 6:12:23 PM3/2/12
to joran, ggplo...@googlegroups.com
I don't know if it's the official location, but David Smith just
blogged about ggplot2 with a link to:
http://cloud.github.com/downloads/hadley/ggplot2/guide-col.pdf

baptiste

Hadley Wickham

unread,
Mar 2, 2012, 7:48:13 PM3/2/12
to baptiste auguie, joran, ggplo...@googlegroups.com
That's where it'll live for now. Putting it on the ggplot2 website
has to wait until I get a chance to revamp the website.

Hadley

--
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/

Reply all
Reply to author
Forward
0 new messages