Hi all,
The words in the x axis are too small to read, so I try to increase by use size = 20. However the x axis didn't change size regardless of input in size
and it is not bold:
ggplot(data, aes(x = Pathway, y = Beta, fill = Genotype)) +
geom_bar(stat = "identity", position = position_dodge()) +
theme(axis.text.x = element_text(angle = 45, hjust = 1, size = 20, face = "bold"))
Would you please have a suggestion? I appreciate it!
Hi Matt, angle 45 didn't work. ggplot2 3.5.1. I just plot in Rstudio.
If the angle45 also didn't work, then there is something odd with the plotting device, either a missing library like Cairo or maybe a lack of permissions. You can try reading through
library(help = "grDevices")
to learn more and change the plotting device. Which plotting device is the default depends on your OS, but the first thing to try would be switching that temporarily.A quick reference for the different devices is usually available with
?png
,?tiff
,?pdf
,?svg
etc. I suspect particularly an issue with the vector devices and the fonts.Thank you so much! Your example code works fine. I guess it is because of my data? Would you please run with the data I provide above?
I really don't see why that should depend on the data being plotted. But I nonetheless tried, and the formatting was applied as well.
Sorry, but I can't help you beyond the dreaded "Works for me / on my machine". If you have e.g. Docker or Singularity, you could try the containerized version of Tidyverse just to double-check that it is not a problem with the Graphics Device.
PS: mind that
melt
is superseded bypivot_longer
in the meantime.Sometimes, I see mysterious results from familiar code. I guess somethings hidden changed that I don't noticed. Thank you for your help!