[Rd] contour() labels (PR#441)

Ray Brownrigg Ray.Brownrigg@mcs.vuw.ac.nz
Thu, 17 Feb 2000 09:36:49 +1300 (NZDT)


> The code has (plot3d.c, ca line 718)
> 
> 		/* Need to send labels in from interpreted R code ? */
> 	        sprintf(buffer, " %.00f ", zc);
> 
> so, yes, it is printed as an integer, and the comment there is right.  
> I guess the labels should be format(levels) by default, to ensure that
> the use of trailing zeros is consistent, but it should be in R code
> so users can override the default precision, say.
> 
Thanks for finding the relevant piece of code.  I did look, but wasn't
au fait enough with C or the R way of doing things to spot the relevant
piece.

How about replacing:
	        sprintf(buffer, " %.00f ", zc);
by:
	        sprintf(buffer, " %.9g ", zc);

It seems to do what I want, and not behave any differently from before
for integer contour lines.

Regards
Ray Brownrigg
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._