Re: [R] Visualize quartiles of plot line

From: hadley wickham <>
Date: Fri, 22 Jun 2007 22:07:37 +0200

On 6/17/07, Arne Brutschy <> wrote:
> Hi,
> thanks for your tips - all of them worked. After a bit of fiddling, I
> managed to get what I wanted.

Glad to hear it.

> hadley wickham wrote:
> h> You might want to read the introductory chapters in the ggplot book,
> h> available from, which will give you more of a
> h> background. Please let me know places where you think the
> h> documentation is inconsistent so I can try and make them better.
> I already did. :) A general problem: the examples are nice and easy to
> get, but it's often hard to apply them to my own specific problem.
> It's more a problem of the general structure: what has to go where.
> Most of the methods are using qplot, but what do I have to do if I'm
> trying create a more complex plot. Hmm, it's hard to describe.
> Example: I know how I set the title when using qplot (qplot(....
> main="asdf"). Where do I have to put it when I'm using gplot? Stuff
> like this is unclear...

p <- ggplot(...) + ...
p$title <- "Title goes here"

It is currently hard to figure this out in the current documentation though.

> A more general problem is, that the manual pages are very, eh,
> minimalistic documented. The overall reference page is good and nicely
> structured. But the big idea is sort of missing. All components are
> linked, but the basics like layout, ggplot, aes etc are harder to find
> - and their help pages are the shortest. Especially the small details
> are hard to figure out. Lists of attributes etc..

Yes, that's definitely something I'm working on for the book. Unfortunately, I don't have
 that much time and it is a lot of work. Every comment helps though.

> Hmm, I know this is not really helpful. I can't describe my problems
> properly, I guess. Perhaps the documentation simply has to improve
> based on users questions. :\
> How old is this package? I think it's really, really great, but are
> there many users? Is there an additional mailinglist or forum where I
> can get more information?

It's pretty young still, although the precursor ggplot package has been around for about a year. I really have no idea how many users there are. For questions, either email me or R-help.

> Some more questions:
> Why doesn't ggplot2 work with layout()? I'm using viewport now, which
> works fine for me, but there should be a note in the docs perhaps.

Because it works with the grid drawing package - see the last chapter in the ggplot book for some details on how to use the grid equivalents.

> How do I change the legend. The auto-creation of it might be nice,
> but I want a) to add a title b) change the order to ascending and c)
> add a short description like:
> DeltaConfig
> [ ] 0 best
> [ ]
> [ ] 5
> [ ]
> [ ]10 worst
> I don't know if this is possible, but it would be nice to explain what
> the colors/values might mean if it's not clear from the beginning
> (ligke diamonds.size). The only thing I found was the attribute
> legend.justifcation in ggopt, which isn't fully documented.

The legends aren't very customisable at the moment - look at the examples for the scale functions to see what you can do. You can see the name of the title easily, and you can change the labels by changing the level of the factors, or setting the breaks argument. I agree there could be more options. If you could provide me with a picture of what you want, I'll add it to my to do list to think about.

> Additionally, how can I change the order of the facets? I currently
> have a plot with a smoother for each model (all in the same plot),
> which sorts the models like this: dyn,dl4,dl3 Below that, I have a
> facet with point-plots for each model which sorts them the other way
> round, which is a bit confusing.

Again, change the order of the underlying factor.

> BTW, what's the "strip" and the associated attributes?

The strip is the labelled associated with the facet.

> Again, I think this package is great - nice work! All the above isn't
> meant as general critisism, but is being said in order to improve the
> documentation..

I do appreciate your comments and they definitely help me to make a better product.


Hadley mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Fri 22 Jun 2007 - 20:38:38 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 22 Jun 2007 - 21:32:46 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.