Discussion:
Change the order how ggplot draws border colors in geom_bar
trichter
2018-06-07 11:28:55 UTC
Permalink
Thank you for this creative solution. I have quite a lot of taxa, so the
scale_color_manual argument will be quite tedious to write, but this will
be better than using illustrator.

Thank yoz!
--
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: https://github.com/hadley/devtools/wiki/Reproducibility

To post: email ***@googlegroups.com
To unsubscribe: email ggplot2+***@googlegroups.com
More options: http://groups.google.com/group/ggplot2

---
You received this message because you are subscribed to the Google Groups "ggplot2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ggplot2+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Crump, Ron
2018-06-07 12:04:54 UTC
Permalink
I have quite a lot of taxa, so the scale_color_manual argument will be quite tedious to write
All you need is to know how many taxa you have, and where within those B sits (plotting
order-wise; which would be alphabetical by default or something else if you've declared a factor
with levels and labels in a specific order).

Then something like:

outlines <- rep("transparent", number_of_taxa)
outlines[position_of_taxon_B] <- "red"
...
ggplot()+....+scale_colour_manual("", values = outlines)

should do it. I hope.

Ron.

________________________________________
From: ***@googlegroups.com <***@googlegroups.com> on behalf of trichter <***@uni-bremen.de>
Sent: 07 June 2018 12:28:55
To: ggplot2
Subject: Re: Change the order how ggplot draws border colors in geom_bar



Thank you for this creative solution. I have quite a lot of taxa, so the scale_color_manual argument will be quite tedious to write, but this will be better than using illustrator.

Thank yoz!

--
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: https://github.com/hadley/devtools/wiki/Reproducibility

To post: email ***@googlegroups.com
To unsubscribe: email ggplot2+***@googlegroups.com
More options: http://groups.google.com/group/ggplot2

---
You received this message because you are subscribed to the Google Groups "ggplot2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ggplot2+***@googlegroups.com<mailto:ggplot2+***@googlegroups.com>.
For more options, visit https://groups.google.com/d/optout.
--
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: https://github.com/hadley/devtools/wiki/Reproducibility

To post: email ***@googlegroups.com
To unsubscribe: email ggplot2+***@googlegroups.com
More options: http://groups.google.com/group/ggplot2

---
You received this message because you are subscribed to the Google Groups "ggplot2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ggplot2+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Liz Harp
2018-06-09 00:26:04 UTC
Permalink
I don't know if you are still dealing with this, but it sounds like
something I had to do recently - I will explain it in terms of my
situation, and you can see if it applies to you.

I have a large data frame with data from other the literature, and data
from my own research. I wanted to highlight my data in scatter plots and a
histogram.
I added a column to my data frame and called it my.data. For my data I
entered "yes" in that column, and everybody else's data got a "no".
In the ggplot function I set fill = my.data, and just had to set two colors
in scale_color_manual to have my bars in one color, and all of the other
bars another color.

I hope this helps - if not, perhaps it will help somebody else :-)

~Liz
--
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: https://github.com/hadley/devtools/wiki/Reproducibility

To post: email ***@googlegroups.com
To unsubscribe: email ggplot2+***@googlegroups.com
More options: http://groups.google.com/group/ggplot2

---
You received this message because you are subscribed to the Google Groups "ggplot2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ggplot2+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...