R Barplot with one bar - how to plot correctly

后端 未结 2 1678
别那么骄傲
别那么骄傲 2021-01-26 11:09

I want to plot a regular bar plot in R, but with just one bar. What I don\'t like is the fact that the bar width gets to be the width of the whole plot. I want the bar to be \"t

2条回答
  •  再見小時候
    2021-01-26 11:40

    You may try to play around with the width of the device you plotting to. E.g.:

    # plot to a Windows graphic device
    windows(height = 10, width = 4)
    barplot(0.5)
    
    # plot to PDF
    pdf(height = 10, width = 2)
    barplot(0.5)
    dev.off()
    

    You may also try width together with xlim

    barplot(0.5, width = 0.1, xlim = c(0, 1))
    

提交回复
热议问题