hrbrmstr / taucharts

:bar_chart: An R htmlwidget interface to the TauCharts javascript library
http://rpubs.com/hrbrmstr/taucharts
Other
65 stars 10 forks source link

custom color palette? #29

Closed ignacio82 closed 9 years ago

ignacio82 commented 9 years ago

Is there a way to use a custom palette? The help file only mentions "tableau10medium", "gray5", "colorblind10", "purplegray12", "bluered12", "greenorange12", "cyclic".

library(taucharts)
tauchart(mtcars) %>%
  tau_point("wt", "mpg", color="cyl") %>%
  tau_color_tableau(palette = "bluered12") %>% 
  tau_legend()

Can I use, for example, this one?

Thanks!

hrbrmstr commented 9 years ago

Please take a look at the whole package help. It covers tau_color_brewer (which that is) as well as a host of others. The tau_color_manual function really lets you use any palette you can generate (which is really any palette).

On Thu, Aug 6, 2015 at 3:26 PM, ignacio82 notifications@github.com wrote:

Is there a way to use a custom palette? The help file only mentions "tableau10medium", "gray5", "colorblind10", "purplegray12", "bluered12", "greenorange12", "cyclic".

library(taucharts) tauchart(mtcars) %>% tau_point("wt", "mpg", color="cyl") %>% tau_color_tableau(palette = "bluered12") %>% tau_legend()

Can I use, for example, this one http://colorbrewer2.org/?type=diverging&scheme=Spectral&n=3?

Thanks!

— Reply to this email directly or view it on GitHub https://github.com/hrbrmstr/taucharts/issues/29.

ignacio82 commented 9 years ago

Thanks!

library(taucharts)
tauchart(mtcars) %>%
  tau_point("wt", "mpg", color="cyl") %>%
  tau_color_manual(c("#fc8d59", "#ffffbf", "#99d594")) %>% 
  tau_legend()