It doesn't seem to be possible to rotate the labels of an xaxis using grid.xaxis(at=, lab=)
by e.g. 90 degrees using a gpar
-option.
Anybody knows a workaround apart from creating separate viewports and using grid.text()
?
Try this,
grid.xaxis(seq(0,1,by=0.1), vp=viewport(y=1),
edits = gEdit(gPath="labels", rot=90))
Check this document: An Example of Interactive Graphics Editing in Grid
library("grid")
gxa <- xaxisGrob(at = 1:4/5, vp = viewport(w = 0.5, h = 0.01))
gxa <- editGrob(gxa, gPath = "labels", gp = gpar(col = "black"), rot=90)
grid.draw(gxa)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With