[R] qplot of ggplot package how to plot different size according to the values and not to the weights?

Stefan Grosse singularitaet at gmx.net
Fri Oct 27 15:53:48 CEST 2006


hadley wickham schrieb:
>
> I think you mean
>> qplot(obserror,Mon,data=obscomp, size=inc.comp,col=step45)

Yes sorry, that was a typo (from playing around with the options)

>> unfortunately the size of the is something I do not want it to be, the
>> legend for inc.comp says: 4, 2.25, 1 ,0.25 , 0 I suppose this are
>> weights?
>
> I think there are two things here that are confusing you (both my fault)
>
> * the size aesthetic actually modifies the area (ie. sqrt(size)) of
> the points, because that is better perceptually
>
> * the legend isn't very good
>
> But it is mapping the inc.comp to the size of the variable.
>

OK So I was confused by the legend values.

>
> qplot currently doesn't have any way to set an aesthetic to a fixed
> value (it can't tell that you're specifying an aesthetic value not a
> data value).  You can do this in two steps though
>
> p <- qplot(wt, mpg, data=mtcars, type=NULL, shape=cyl)
> ggpoint(p, size=3)
>
Thanks that looks better. And when I do the as.factor I have the
different values (and as.factor in the legend but that does not matter).


>> Another thing what I like to complain about is that qplot is using only
>> half of the windows graphics device space (especially wen adding this
>> size =3) which is not only ugly but a waste of space...
>
> That sounds like a bug.  Could you please provide a reproducible example?
>
already sent to you and the list.

Thanks a lot.

Stefan



More information about the R-help mailing list