gforge / forestplot

Advanced forest plots in R using grid graphics
44 stars 15 forks source link

Adding colors to ticks or xlab #23

Closed th-zelniker closed 3 years ago

th-zelniker commented 6 years ago

Is it possible to add colors to ticks and xlabs? It works perfectly for labels but I can't make it work for xticks or xlabs...

txt_gp = fpTxtGp(label = list(gpar(fontfamily = "HersheyScript"), gpar(fontfamily = "", col = "#660000")), xlab = gpar(fontface = "bold", cex = 1.5, col = "#660000")) ticks = gpar(fontface = "bold", col = "blue", cex=1))

gforge commented 6 years ago

This functionality is currently not in place. If you feel you're up to it - please submit a PR, sounds like a good idea.

th-zelniker commented 6 years ago

Not sure if I have the expertise but will try.

Just noticed that one can bypass this issue using: col = fpColors(axes = "blue")

gforge commented 6 years ago

There are helper functions that you need to dive into. I first create some of the grobs and then plot them.

Check out this line for the grob creation: https://github.com/gforge/forestplot/blob/master/R/forestplot.R#L517

and this is where part of the actual plot of the axis happens: https://github.com/gforge/forestplot/blob/master/R/forestplot.R#L747

gforge commented 3 years ago

Closing due to lack of activity