【问题标题】:barplot overwrites on axis names when changing axis limits更改轴限制时,条形图会覆盖轴名称
【发布时间】:2017-04-27 12:50:34
【问题描述】:

我有以下数据框:

datatest=as.data.frame(matrix(c(4,5,-10,2,-3,7),6,1))
rownames(datatest)=paste0("row",1:6)

我有以下条形图

barplot(datatest$V1,horiz = TRUE,names=rownames(datatest),las=1,col="black")

original barplot

但是,当我更改轴时,绘图会覆盖这样的名称:

barplot(datatest$V1,horiz = TRUE,names=rownames(datatest),las=1,col="black",xlim=c(-5,5))

barplot with axis changed

如何使条形图在名称之前停止?

【问题讨论】:

    标签: r bar-chart names


    【解决方案1】:

    使用“xpd=F”选项。看看help page for barplot

    【讨论】:

      猜你喜欢
      • 2021-05-07
      • 2021-06-28
      • 2023-03-14
      • 1970-01-01
      • 2016-03-08
      • 1970-01-01
      • 2015-01-14
      • 2014-06-06
      • 1970-01-01
      相关资源
      最近更新 更多