I have to draw a phase space graph. Is it possible to draw the axis at the center at (0,0)? TIA
myriam
4 messages · Myriam Abramson, Uwe Ligges
I have to draw a phase space graph. Is it possible to draw the axis at the center at (0,0)? TIA
myriam
I need to shade one area of a graph. Any ideas on how to do that?
myriam
I have to draw a phase space graph. Is it possible to draw the axis at the center at (0,0)?
Yes, using axis() with argument "pos", see ?axis. Example: y <- rnorm(21) plot(-10:10, y, axes=FALSE) axis(1, pos=0) axis(2, pos=0) # OK. Looks ugly (the zero). Next try: plot(-10:10, y, axes=FALSE) axis(1, pos = 0, at = c(-10, -5, 5, 10)) yprt <- pretty(y) yprt <- yprt[yprt != 0] axis(2, pos = 0, at = yprt) Uwe Ligges
I need to shade one area of a graph. Any ideas on how to do that?
First set up your plot( ...., type = "n"). Then draw the shading using polygon(...., col = "grey"), after that the lines() and points() to appear in front of it. Uwe Ligges