Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for ggplot themes #24

Open
ngehlenborg opened this issue Jul 15, 2015 · 7 comments
Open

support for ggplot themes #24

ngehlenborg opened this issue Jul 15, 2015 · 7 comments
Assignees

Comments

@ngehlenborg
Copy link
Member

http://docs.ggplot2.org/0.9.2.1/theme.html

Some discussion about which parts of the plot should not be affected by themes will be required.

@JakeConway
Copy link
Member

what are some examples of themes that you would want to implement? there are built in schemes, then theres obviously all of those parameters for full customization. what should we allow?

@ngehlenborg
Copy link
Member Author

My understanding is that by using the variables defined by the themes we would essentially be able to support any theme: http://docs.ggplot2.org/dev/vignettes/themes.html

@JakeConway
Copy link
Member

@ngehlenborg : I could add a labels parameter that could control the sizes and maybe fonts to the axis labels, set names, and intersection sizes?

@ngehlenborg
Copy link
Member Author

My suggestion for themes is motivated by the fact that the list of parameters is already so long. Would it be hard to add support for themes? (which might be more in line of what people are generally doing with plots based on ggplot2)

@JakeConway
Copy link
Member

How would we specify what plot the theme belongs to?

@martincadek
Copy link

martincadek commented Feb 12, 2020

Could anyone please confirm if anyone has any workaround for this issue? In my case, I'd like to use themes in order to change the default family of fonts. If UpsetR is to be used in scientific journals, most likely it will need to support this. The ideal scenario I wish I could use would be the following:

# using extrafont v0.17; UpSetR v1.3.3; ggplot2 v3.1.0
upset(data = movies, 
      order.by = "freq", 
      keep.order = TRUE,
      mainbar.y.label = "Example plot", 
      point.size = 4, 
      line.size = 1,
      sets.x.label = NULL) +
     theme(text = element_text(family = "Times New Roman"))

But if @JakeConway would be happy to add labels parameter that supports this OR suggest what functions would need to be modified to customise it, that would be really helpful!

@tomlincr
Copy link

@martincadek it seems you can use theme_set() as a workaround for font family, but unfortunately not for font size (which I came here looking for!)

plot_theme = theme_grey() %+replace%  
  theme(text = element_text(family = "Times"))
theme_set(plot_theme)
p = upset(data = movies, 
      order.by = "freq", 
      keep.order = TRUE,
      mainbar.y.label = "Example plot", 
      point.size = 4, 
      line.size = 1,
      sets.x.label = NULL) 
p 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants