Skip to content

barplot - how to force vertical axis to cover entire plot area

2 messages · Etienne, Uwe Ligges

#
I'm using barplot with the following call:
  
barplot(stat_data[[5]][,],axes=TRUE,axisnames=TRUE,axis.lty=1,xlab=xlab,ylab=ylab,beside=TRUE,las=1,font.lab=2,font.axis=1,legend.text=TRUE)

On some data, the vertical axis does not cover the
whole plot area and the last tick mark is smaller than
the maximum value.

I tried setting the ylim values but even with that,
some plots are still not OK, it just shrinks the
length of the bars.

Attached is a png example of the problem.  I hope it
gets through.

Thanks,
Etienne

__________________________________________________


-------------- next part --------------
A non-text attachment was scrubbed...
Name: precipday_mex_total.png
Type: image/png
Size: 3363 bytes
Desc: 1841399767-precipday_mex_total.png
Url : https://stat.ethz.ch/pipermail/r-help/attachments/20061206/331cc872/attachment-0006.png
#
Etienne wrote:
The example is not reproducible and poorly formatted. Please read the 
posting guide.
R tries to make the plot pretty, i.e. stop with some tick mark like 200, 
but not e.g. 242.

Perhaps you want to make a box() around the plot?


Uwe Ligges