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

Presentation mode #92

Closed
seabbs opened this issue Nov 4, 2019 · 4 comments · Fixed by #97
Closed

Presentation mode #92

seabbs opened this issue Nov 4, 2019 · 4 comments · Fixed by #97

Comments

@seabbs
Copy link
Owner

seabbs commented Nov 4, 2019

Issue

Figures are often presented via slides to stakeholders. Readability is very important in these contexts. It may make sense to increase text size as well as potentially other aspects of figures.

Suggested solution

Add a presentation = FALSE/TRUE argument to all plotting functions that tweaks plot defaults to aid readability. An alternative solution would be the addition of a new function (something like for_presentation) to update plots for use in presentations.

@mariabnd
Copy link
Contributor

Would adjusting the aspect ratio and increasing the font size be enough?

If so something like

library(ggplot2)
library(getTBinR)

plot <- getTBinR::plot_tb_burden_summary(countries = "United Kingdom", 
                                         compare_all_regions = FALSE, 
                                         compare_to_region = TRUE)

for_presentation <- function(plot, aspect_ratio = 0.5, font_increase = 1.5, ...){
  plot <- plot + theme(aspect.ratio = aspect_ratio)
  plot <- plot + theme(text = element_text(size = plot$theme$text$size * font_increase))
  
  return(plot)
}

plot # Original
presentation(plot) # After adjustments

should work (or the changes to theme could be incorporated in the plot functions cf. the suggested TRUE/FALSE argument)

@seabbs
Copy link
Owner Author

seabbs commented Mar 15, 2020

This is a nice solution. I like the separate wrapper function idea.

FYI the CRAN update including your changes is ready but has been delayed by the COVID outbreak (my new job is outbreak forecasting and it turns out that makes this a busy time).

Hopefully will be able to push forward soon on this.

@mariabnd
Copy link
Contributor

No worries; everything is COVID-19 atm. I'll add some documentation and submit a pull request.

And congrats on the new job!

@mariabnd
Copy link
Contributor

Have submitted #97

@seabbs seabbs linked a pull request Jun 10, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants