[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 11:19:11 CEST 2006
I have the following Data structure
$ step45 : Factor w/ 2 levels
$ obserror : num 6.2 6.2 5.6 6.6 6.6 ...
$ Mon : num 2.2 2.0 1.0 3.2 2.0 ...
$ inc.comp : num 4 5 2 5 5 5 5 5 4 4 ...
all I wanted to do is plotting Mon against obserror, the colors should
be by step45 and the size of the symbol should be according to inc.comp
so I did this:
qplot(obserror,Mon,data=obscomp,col=inc.comp,col=step45)
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 got closer to what I want specify a different symbol instead of a
different size:
qplot(obserror,Mon,data=obscomp,shape=as.factor(inc.comp),col=step45)
I needed the as.factor otherwise the plot is again different. But that
did not work with size. OK I thought this is a second best solution but
unfortunately the symbols are to small. But setting a size = 3 which I
thout adds a constant size everywhere (somehow expectedly) did add a
third legend "3" with 3.61, 3.42, ...
(The color worked fine)
Unfortunately the documentation of qplot is rather short ("FIXME")...
So is there a kind of option to use for the size just the values and not
the weights? Or a possibility to switch of "3" for legend plotting?
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...
Stefan
R-2.4.0
Windows XP Prof.
More information about the R-help
mailing list