Skip to content

Plot Axes

5 messages · dpender, jim holtman, Gavin Simpson

#
R community,

I am creating a bivariate return level plot by adding calculated return
period values as lines onto an existing plot using the following code with
the points representing the return periods.

plot(H2,D2,pch="+",axes=TRUE)
points(H.10,D.10, type="l",col="blue")
points(H.20,D.20, type="l",col="green")
points(H.50,D.50, type="l",col="red")
points(H.100,D.100, type="l",col="orange")

The problem is that my return period values are greater than the data values
and therefore are partially cut out of the plot.

How can I increase the axes limits in order to include all of the return
period lines?

I've tried ## xis(2,at=seq(35,max(D.100),by=20)) ## but it doesn't work.

Thanks,

Doug
#
apply the xlim/ylim in the initial plot

plot(..., xlim=range(H2, H.10, H.20, H.50, H.100), ylim=range(D2,
D.10, D.20, D.50, D.100))
On Wed, Nov 10, 2010 at 12:50 PM, dpender <d.pender at civil.gla.ac.uk> wrote:

  
    
#
Thanks  Jim,

The next issue is how i get the RP lines to cut the axes. The lines either
cut the x axis at D=35 or the y axis at H=4.5.

How do I set the axes so that the lines start and end on the axes?

http://r.789695.n4.nabble.com/file/n3037496/plot.jpeg
#
On Thu, 2010-11-11 at 01:41 -0800, dpender wrote:
See ?par and in particular 'xaxs' and 'yaxs'

e.g.:

plot(1:10, xaxs = "i", yaxs = "i")

G