how do you rotate the column titles in vis_miss (naniar library)? They are tilted in the default settings, I would like the titles to be vertical (parallel to the y-axis of the graph). Thanks for your help!
Asked
Active
Viewed 1,336 times
1
-
2Please, read [this](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) to help to be helped. – s__ Sep 03 '18 at 09:29
2 Answers
1
The current behaviour of vis_miss()
is the following:
library(visdat)
vis_miss(airquality)
Created on 2018-11-04 by the reprex package (v0.2.1)
As visdat is built on top of ggplot2, you rotate the y axis labels 90 degrees, like so:
library(visdat)
library(ggplot2)
vis_miss(airquality) +
theme(axis.text.y = element_text(angle = 90))
Created on 2018-11-04 by the reprex package (v0.2.1)
Which I found from this: Rotating and spacing axis labels in ggplot2

Nick Tierney
- 192
- 1
- 8
-
1Your plots are equal. There is no change since the axis which has to be rotated is the x axis. – iago Oct 15 '19 at 09:52
-
axis.text.x should replace axis.text.y since he's talking about the rownames displayed at a 45 degree angle. – ibm Aug 25 '21 at 20:59
0
theme(axis.text.x = element_text(angle = 90))
or whatever other angle degree instead of axis.text.y
to change the variable labels on top.

ibm
- 744
- 7
- 14