RFC: adding theme component(s) for guide_colorbar tick mark styling

17 views
Skip to first unread message

Christian Gunning

unread,
Mar 25, 2017, 4:10:27 AM3/25/17
to ggplo...@googlegroups.com
At present, there are limited options for styling colorbar ticks Other axis ticks are controlled by components of theme, but the colorbar ticks are hard-coded [ref https://github.com/tidyverse/ggplot2/blob/master/R/guide-colorbar.r#L354].

Is this in anyone's sights? I've considered the following options:

A) Follow the model of theme(axis.ticks=element_line(...)): Add a theme component named colorbar.ticks of class 'element_line'. I looked at the source for axis tick handling, and I believe such a change is outside my current competence envelope.

B) Simple solution: add several components to theme, which are then used by guide_gengrob.colorbar [ ref. https://github.com/tidyverse/ggplot2/blob/master/R/guide-colorbar.r#L234].  This is something I could handle via PR.

Specifically, I'm looking at the gpar options {col, lwd} and tick length (currently hard-coded at 1/5 bar width). So, the legend components would be:

* colorbar.ticks.size (class 'unit', currently lwd=0.5 mm)
* colorbar.ticks.length (class 'unit', currently hard-coded as 1/5 bar width)
* colorbar.ticks.color (character, currently col='white')

Thoughts on proposal B? Does anyone have plans resembling A?

Thanks!
Christian

--
A man, a plan, a cat, a ham, a yak, a yam, a hat, a canal – Panama!
Reply all
Reply to author
Forward
0 new messages