Search code examples
rgraphicsplotarea

Plotting fixed plot area


I have simple question, how can I plot fixed height barplots, i.e. stretching the plot area only change margins not the bararea, like the following:

> A <- 4
> plot (A)

> barplot(A, col = "green4")

enter image description here

When I strech are, bar area also get increases.

enter image description here

Edits: I want to keep the box size constant even the plot gets stretched.

enter image description here


Solution

  • by splitting the screen into multiple parts, you can achieve that partially:

    split.screen(c(3,1))
    A <- 4
    barplot(A, col="green4")
    

    enter image description here