Dear,
I wonder if there is a way to 'play' with colors in facet ggplot and
geom_bar.
With reference to the attached figure, I'd like to
- color the green portion based on a numerical variable (say 1 to 10) on
all of the four panels and
- color-code the y labels based on the values of the 'bias' (red portion
of bars) only on the fourth panel.
the code to produce the plot is:
ggplot(Data, aes(x=mod_names, y=value,
fill=err_type))+geom_bar(stat='identity', position='stack') +
facet_wrap(~spec_comp, nrow=1,
scales="free") +
theme(axis.text.x = element_text(angle = 90, vjust = 0.5,
hjust=1.)) +
theme(axis.title.x = element_blank())+ ylab(units) +
geom_text ( aes(label=sign.value, y=pos)) +....
where err_type = c('bias', mMSe', 'var')
thanks for any hint.
--
Efisio SOLAZZO, Ph.D.
European Commission, Joint Research Centre,
Institute for Environment and Sustainability,
TP123, Via E. Fermi, 2749 I-21027 Ispra (VA), Italy
Tel: +390332789944 Fax: +390332785837
______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.