medialab / iwanthue

Colors for data scientists.
http://tools.medialab.sciences-po.fr/iwanthue/
Other
636 stars 57 forks source link

please a tutorial for using iwanthue use in R / ggplot2 #7

Open dksamuel opened 10 years ago

dksamuel commented 10 years ago

Iwanthue is so nice , will anyone make a tutorial for using iwanthue use in R / ggplot2, thanks

hoesler commented 9 years ago

I created a simple package to generate an Iwanthue palette in R: https://github.com/hoesler/rwantshue

dksamuel commented 9 years ago

Please show me one tutorial, I run the commands, but where is the color palette, thanks Dr.Samuel, India

On Thu, Jan 22, 2015 at 5:19 AM, Christoph Hösler notifications@github.com wrote:

I created a simple package to generate an Iwanthue palette in R: https://github.com/hoesler/rwantshue

Reply to this email directly or view it on GitHub https://github.com/medialab/iwanthue/issues/7#issuecomment-70945893.

hoesler commented 9 years ago
library(rwantshue)
color_scheme <- iwanthue()
color_scheme$hex(8)

should produce something like

[1] "#92C3AE" "#B15BCA" "#C0513A" "#84CA54" "#4C4538" "#7E82B6" "#BDA04D" "#B0517A"

I use it to scale color in ggplot like this:

gg <- gg + scale_color_manual(values = color_scheme$hex(nrow(data)))

Does that answer your question? Please be sure to install the latest version as described in the install section of the readme.

Cheers, Christoph

dksamuel commented 9 years ago

Dear Christoph, it answers my question, thanks Samuel

On Thu, Jan 22, 2015 at 3:35 PM, Christoph Hösler notifications@github.com wrote:

library(rwantshue)color_scheme <- iwanthue()color_scheme$hex(8)

should produce something like

[1] "#92C3AE" "#B15BCA" "#C0513A" "#84CA54" "#4C4538" "#7E82B6" "#BDA04D" "#B0517A"

I use it to scale color in ggplot like this:

gg <- gg + scale_color_manual(values = color_scheme$hex(nrow(data)))

Does that answer your question? Please be sure to install the latest version as described in the install section of the readme.

Cheers, Christoph

Reply to this email directly or view it on GitHub https://github.com/medialab/iwanthue/issues/7#issuecomment-70997570.