combmatrix strip color with a palette
itsvenu opened this issue · 3 comments
Hi,
This is really an awesome package. I was just wondering is there a way to specify colors for comb matrix strips with a palette. For example, as in Fig 3 in this page https://www.r-bloggers.com/hacking-our-way-through-upsetr/.
Would be very handy if there is a tweak.
Thank you.
Hi Venu,
I am not quite sure if I understood your question correct. You can easily change the color of the stripes using the theme_combmatrix()
function.
library(ggplot2)
library(ggupset)
ggplot(tidy_movies, aes(x=Genres)) +
geom_bar() +
scale_x_upset() +
theme_combmatrix(
combmatrix.panel.point.color.empty = "darkgrey",
combmatrix.panel.striped_background.color.one = "#caeace",
combmatrix.panel.striped_background.color.two = "#a18dec",
)
Created on 2019-03-11 by the reprex package (v0.2.1)
If you want to define an individual color for a specific set (e.g. Drama), this is currently not supported, because I am not sure what the best way is to give the advanced users the necessary flexibility, without overloading new users with too many options.
Best, Constantin
Hi Constantin,
Thanks for the reply.
If you want to define an individual color for a specific set (e.g. Drama), this is currently not supported.
This is basically what I want. I was checking the source code to hack few things (only to fit my purpose atm). Anyways, thanks for writing one of the cool packages.
P.S. Wouldn't it be possible (a bit easier) to keep white/gray as default and provide an option to specify colors for each strip (as in UpSetR package)?
Hi Venu,
P.S. Wouldn't it be possible (a bit easier) to keep white/gray as default and provide an option to specify colors for each strip (as in UpSetR package)?
Yes, I could just add an option in the theme to specify the color for the stripes as a list, but I believe this is a slippery slope, because why not also add an option to change the color of the dots for one intersection, or it's shape etc. I am reluctant to add those specific options because it would never be enough and I would prefer a solution that gives the user the necessary flexibility without overloading the user interface, but I am just not yet sure how to achieve that. Maybe I will add a scale with a callback function that allows the user to make any plot with any style he likes for the x-axis.
I was checking the source code to hack few things (only to fit my purpose atm)
I think that for now, that this is probably the best way to go.