0

How can I color code for two different variables? Currently I alter the opacity:

  scale_alpha_manual(values=c(1, 0.5), labels=c("net sales", "contribution margin"),name = "Opacity") + # opa

So the 2nd bar in the chart is always a little transparent. However what I would really like to have is the 2nd (and following) bar(s) in a group to be gradually darker / brighter versions of the first one without introducing transparency.

my current graph

florian
  • 604
  • 8
  • 31
  • 2
    can you provide some sample data, e.g. using `dput()` – Roman May 20 '16 at 11:41
  • I still have to learn how to use dput correctly and in this case it is confidental data so I have to make something up....but just imagine a data set with a factor country with 6 levels. For each level of country you have two numeric values, one for net sales and one for contribution margin. – florian May 20 '16 at 13:03
  • No problem. Build the data by your own using `runif()` for instance or replace the values and factor labels. This link might help. http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – Roman May 20 '16 at 14:05

0 Answers0