On Jun 1, 2015, at 2:03 PM, ivo welch wrote:

> can I add ordinary graphics commands to a contourplot?  my naive
> attempts are telling me that plot.new() has not yet been called when I
> try to add text(1,1,"hi") or points( c(0,1), c(1,0) )?

There are lattice equivalents to many of the base primitives. They can be used 
inside lattice/trellis functions or used later if the plots have been save to 
names.

?llines
?trellis.focus

Also take a look at the lattice Extra and gridBase packages for additional 
faclities like these.

Examples requested for demonstration ... as always but using your earleir 
example:

 myplot=     contourplot( z ~ x * y, data = d)
 myplot
 trellis.focus("panel",1,1)
 llines(x=3, y=1:5)  #draws a blue segment on the screen device
NULL
 trellis.unfocus()

But that is not going to change myplot. For that you need ?update.trellis or 
latticeExtra's version of "+".


-- 
david.
> 
> [or do I need to rewrite another contourplot with the old graphics
> system.  the basics are probably looking at adjacent points,
> pretending that they are linear, and mark where a line between them
> intercepts the level, and then hope that some sanity prevents me from
> connecting disconnected levels.  not my plan...]
> 
> ----
> Ivo Welch (ivo.we...@gmail.com)
> http://www.ivo-welch.info/
> 
> ____


David Winsemius
Alameda, CA, USA

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

Reply via email to