I'm having an issue with certain letters and numbers being cutoff/clipped when saved to png. It does not happen if I view the plots within RStudio. It happens with other fonts too besides Palatino, e.g. Book Antiqua.
In the image below you can see that the 'e' is cut off when written vertically but not horizontally. Happens also to some of the tick labels. I have tried different image height/width combinations and it doesn't seem to change it. I checked if it is because the 'e's are at the end of words by putting them in the middle of words also, but seems to be a property of the character regardless of placement. I'm thinking it has something to do with par("cra") or one of those read-only parameters but haven't had success in finding a fix.
I know that I could likely avoid this by using ggplot2
but it is an old code relic and quite complicated to convert out of base plotting. Any suggestions for base plotting?
Windows 10, R 4.0.3, RStudio 1.3.1093
Thanks!
Reprex:
png("650_800.png", type="cairo-png", width=650, height=800, family="Palatino Linotype")
plot(x=1,y=1)
mtext("Absoelute moistuere ", side=1, cex=1.2)
mtext("Absoelute moistuere ", side=2, cex=1.2)
mtext("Absoelute moistuere ", side=3, cex=1.2)
mtext("Absoelute moistuere ", side=4, cex=1.2)
dev.off()