Closed lucindalawrie closed 2 years ago
Yeah this is a great idea! TPP have made a couple of abortive attempts in the past at making a package to create a ggplot theme (inspired by the BBC's bbplot
package). I think it would be much better to have a phs_style()
function within this package that deals with colours plus font, text size etc. Maybe I'm getting ahead of myself though. As long as it's something that could be easily applied to a ggplot then it'd be absolutely fine to concentrate on colours to begin with.
Edit: this recent vignette on using ggplot2 within packages could be useful for this.
The bbplot package looks fab! I'd be up for giving this a go with my QI R project hat on. Obviously it requires confirmation of what the PHS style guide will be first...
Sounds good! Yeah fine to wait for news on the style guide, there's no hurry.
Creating a standard style theme for plots is a very good idea and could use TPPs previous attempts as a base. I think the biggest difficulty would be to create standard quality set of palettes, which the bbplot package doesn't do as far as I can see (I did something for ScotPHO on these lines but probably it would need quite a bit of work to make it work for the wider organisation). If you wanted to create standard sets of colour palettes I think it could be problematic to restrict yourself to the corporate colours , as I remember the ISD/NSS "recommended" ones as very bad from a visualisation/design/accessibility point of view. There are so many types of potential cases that you need a wide range of options. A PHS style guide could also take a very long time and the function can always be adjusted when that is out.
Yeah I think I would start off by trying to make a theme using PHS colours for plots in publications and taking it from there. Developing a full set of colour palettes that are fully accessible is a good aspiration to have, but it would probably be quite an arduous process and I wouldn't want it to bog down something more immediately achievable like developing a ggplot theme. People will still be putting out the same old charts in publications for a while yet and I think the immediate priority should be to standardise the design of those in R.
Hi @lucindalawrie - did you manage to get anywhere with this? I'm working on a couple of projects at the moment where I'm repeating a lot of code to set ggplot themes. I've written a function to apply a simple theme to charts I use, but it would be much more helpful if it was in phsmethods
- would save me copying the function between projects and open up for others to use. Would be quite keen to get involved in this if its not already been done! I've also tried to set up some sort of colour scheme but agree with comments above that this will take a lot more thought. Maybe we could chat in the new year? 😄
Hi @alicebyers5, this has taken a back seat as covid work has taken priority but I would definitely be up for a chat in the new year about getting this restarted - it's something that I think would be useful for lots of teams 😄
Since "phsstyles" package has been developed I'm going to close this issue.
Hi @Tina815 - hope you're well! phsstyles
looks great - I'm actually looking to develop something similar for SG so will be a great help to see how you've done it!
Whilst at the PHS engagement session yesterday a colleague in NHS Lothian suggested an R function that, if I interpreted her suggestion correctly, will format charts using PHS colour schemes (or PHS approved colour blind friendly colour schemes)... Haven't given this much thought as yet but thought I would raise the issue before I lose the post it note she wrote her suggestion on!