绘图外的垂直 x 标签
Vertical x labels out of plot
我有一个图,其中我通过 las = 2
引入了垂直 x 轴标签。这些标签是类别词。这些话太长了,它们突出了画面。我该怎么做才能使它们符合图片?
这是代码(x 轴标签是德语单词):
categories <-c("Traditionsbewusst / Heimatverbunden","Bekanntheit
","Jugendlich / Modern
","Professionell
","Sozial engagiert
","Aufstrebend / Motiviert
","Umwelt / Nachhaltigkeit
","Sympathisch
","Familienfreundlich
","Mitreißend
","Posetives Image
","Teamgeist
","Inovativ
")
Ergebnis<-c(2,1,2,2,2,2,2,2,2,2,3,2,2)
plot(Ergebnis,type = "b",main = "Profil Image",xlab = "",ylab = "Bewertung",axes =FALSE)
axis(1,at=1:13,labels = categories,las=2,cex.axis=0.8)
axis(2)
您可以使用 par(mar(c(bottom, left, top, right)))
调整页边距,其中底部、左侧、顶部和右侧以及以英寸为单位的相应页边距大小。在您的情况下,plot()
命令之前的 运行 par(mar = c(15, 3, 3, 3))
似乎可以解决问题。
我有一个图,其中我通过 las = 2
引入了垂直 x 轴标签。这些标签是类别词。这些话太长了,它们突出了画面。我该怎么做才能使它们符合图片?
这是代码(x 轴标签是德语单词):
categories <-c("Traditionsbewusst / Heimatverbunden","Bekanntheit
","Jugendlich / Modern
","Professionell
","Sozial engagiert
","Aufstrebend / Motiviert
","Umwelt / Nachhaltigkeit
","Sympathisch
","Familienfreundlich
","Mitreißend
","Posetives Image
","Teamgeist
","Inovativ
")
Ergebnis<-c(2,1,2,2,2,2,2,2,2,2,3,2,2)
plot(Ergebnis,type = "b",main = "Profil Image",xlab = "",ylab = "Bewertung",axes =FALSE)
axis(1,at=1:13,labels = categories,las=2,cex.axis=0.8)
axis(2)
您可以使用 par(mar(c(bottom, left, top, right)))
调整页边距,其中底部、左侧、顶部和右侧以及以英寸为单位的相应页边距大小。在您的情况下,plot()
命令之前的 运行 par(mar = c(15, 3, 3, 3))
似乎可以解决问题。