I'd love to find out I'm doing something wrong. I'm using ggplot2
version 0.8.5 on R 2.10.0 (the problem also happened for me on ggplot2
version 0.8.3)
I have some sample code and a small data set to reproduce the problem.
Here's a working chart:
http://drop.io/iop0fnj/asset/consistent-order-png
note the columns are ordered red, green turqoise and purple
And with faceting:
http://drop.io/iop0fnj/asset/inconsistent-order-png
see that the ordering of the colors varies between time points.
I'm using this code: (posted here: http://drop.io/iop0fnj/asset/facet-wrap-issue-r)
data=read.csv("ggplot_example_data.csv");
data$days_on_site=ordered(data$days_on_site);
data_A = subset(data,feature=="A");
ggplot(data_A,aes(x=month,y=fraction,fill=days_on_site)) + geom_bar
(stat="identity",position="dodge") + opts(title="This chart has
consistent ordering");
dev.new();
ggplot(data,aes(x=month,y=fraction,fill=days_on_site)) + geom_bar
(stat="identity",position="dodge") + facet_wrap(~ feature) + opts
(title="This chart does not have consistent ordering");
My data set is posted here: http://drop.io/iop0fnj/asset/ggplot-example-data-csv
Thanks!
--
You received this message because you are subscribed to the ggplot2 mailing list.
To post to this group, send email to ggp...@googlegroups.com
To unsubscribe from this group, send email to
ggplot2+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/ggplot2