[R] axes
Duncan Murdoch
murdoch at stats.uwo.ca
Tue Feb 3 15:48:15 CET 2009
On 2/3/2009 9:18 AM, Montserrat, Francesc wrote:
> Hello there,
>
> Is there a functionality or command that generates axes in the shape of a capital Greek letter gamma (upside down L) ? I use these for making sediment profiles. I have read through help-lists, tried different things and asked several people but never got a satisfactory result.
> I've tried the following:
>
> xx <- c(2,4,6,5.8,5,4,3,1.5,0, 0, 0, 0)
> yy <- (0:-11)
> plot(NULL, NULL, ylab="depth (cm)", xlim=c(0,8), ylim=c(-12,1), las=1, xaxt="n", bty="n", xlab="")
> axis(3)
> points(xx, yy, pch=19, col=2)
> mtext(3, text="concentration", line=2.5)
>
> Not bad, but a bit complicated for such a seemingly simple thing...also, the axes do not intersect, something I would like them to do as in the bty="l" command. I hope anyone knows a more elegant solution...
As far as I can see there's no reason not to plot the points in the
original call to plot, but I don't think you can make it much more
"elegant" other than writing a function to do it. You will probably
need to use lines() or segments() to draw your Gamma axes right out to
the corners, e.g.
usr <- par("usr")
lines(usr[c(1,1,2)], usr[c(3,4,4)])
Duncan Murdoch
>
>
> Francesc Montserrat
> Spatial Ecology department, NIOO-CEME
> Korringaweg 7
> 4401 NT Yerseke
> The Netherlands
> +31-(0)113-577470
>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help
mailing list