[R] contours and cutlines

Robin Hankin r.hankin at noc.soton.ac.uk
Fri Jun 10 14:20:57 CEST 2005


Hi

Using contour(), one can plot pretty pictures (of potential flow); my 
problem is removing
the cutline.  If I do:

  x <- seq(from=-4,to=4,len=100)
z <- outer(x,1i*x,"+")
contour(x,x,Im(log(z)))

everything is fine except the discontinuity along the negative real 
axis, which derives
from log()'s cutline.

Before I try to reinvent the wheel, does anyone have a nice way of 
getting rid of the ugly
bunch of contours that correspond to the discontinuity along the cut 
line?

Also,  something like

contour(x,x,Im((1+2i)*log(z^2/(z-2-1i)/(z-2+1i))),nlevel=33)

has a more complicated cut line.  Has anyone got any ideas how to 
improve the plot (ie
allow the flow lines to be nicely continuous everywhere except the 
sources)?



--
Robin Hankin
Uncertainty Analyst
National Oceanography Centre, Southampton
European Way, Southampton SO14 3ZH, UK
  tel  023-8059-7743




More information about the R-help mailing list