Rotate labels in grid.xaxis

It seems that it is not possible to rotate xaxis labels with grid.xaxis(at=, lab=) , for example. 90 degrees using gpar -option.

Does anyone know a workaround besides creating separate viewports and using grid.text() ?

+4
source share
2 answers

Check out this document: An example of interactive graphics in a 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) 
+5
source

Try it,

 grid.xaxis(seq(0,1,by=0.1), vp=viewport(y=1), edits = gEdit(gPath="labels", rot=90)) 
+5
source

Source: https://habr.com/ru/post/1390389/


All Articles