0
我遇到的问题与How can I make my vertical labels fit within my plotting window?中的人相同,但在Jupyter中。当我在Jupyter内的R上制作一张barplot时,任何长的垂直x轴标签都会被切断。例如在Jupyter R中切断X轴标签
animals = c("dog","cat","squirrel","dog","fox","dog","llama","cat","tyrannosaurus rex")
sorted <- sort(table(animals), decreasing=T)
barplot(sorted, las = 2)
使用解决链接的问题
animals = c("dog","cat","squirrel","dog","fox","dog","llama","cat","tyrannosaurus rex")
sorted <- sort(table(animals), decreasing=T)
par(mar = c(15,4,4,2) + 0.1)
barplot(sorted, las = 2)
作品在R贵为Mac而不是在Jupyter。
我也试图与再版及其选项打,例如
library(repr)
options(repr.plot.width=4, repr.plot.height=4)
不过,虽然是可以收缩和伸展的情节,底部仍然得到切断。
任何想法?