【问题标题】:Vertical x labels out of plot图中的垂直 x 标签
【发布时间】:2020-09-25 18:22:24
【问题描述】:

我有一个情节,我通过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)

【问题讨论】:

    标签: r plot label diagonal


    【解决方案1】:

    您可以使用par(mar(c(bottom, left, top, right))) 调整页边距,其中底部、左侧、顶部和右侧以及相应的页边距大小(以英寸为单位)。在您的情况下,在 plot() 命令之前运行 par(mar = c(15, 3, 3, 3)) 似乎可以解决问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-01-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多