[R] Help confidence interval graphics

Michael Bibo michael_bibo at health.qld.gov.au
Wed Apr 25 21:32:14 CEST 2012


rafitoariaz <rafitoariaz <at> hotmail.com> writes:

> 
> Hi everybody. I'm making a confidence interval plot using the function
> plotCI. I would like to decrease the space between the lines. How can I do
> that? Thanks alot 

There may be a better answer than this, but here goes:

The lines are plotted at 1, 2, 3, 4, etc on the 'categorical' axis, and that
axis automatically displays just the range of values necessary.  So if you have
four confidence intervals plotted, the 'categorical' axis will range from 1 to
4.  You can reduce the distance between the lines by changing the aspect ratio
of your plot device, ie, make the plot narrower along that categorical axis and
the plot will be adjusted accordingly.

Alternatively (or additionally), you can alter the range of the categorical
axis, using the xlim or ylim argument (depending on whether your lines run
vertically or horizontally).  By making the range on that axis larger, you
create more 'white space' at each end of the scale and the lines cluster
together in the centre more.

Note that you can also customise your axes with axis(), like other plots.


Hope this helps,

Michael Bibo
Queensland Health



More information about the R-help mailing list