[R] plotting partial deriviatives

Uwe Ligges ligges at statistik.uni-dortmund.de
Sun Mar 5 14:43:51 CET 2006


Charles Annis, P.E. wrote:

> Dear R Helpers:
> 
> I am trying to annotate a plot.  The following code snippet works, but it is
> kind of a kludge since it adds the partial derivative symbols after creating
> the plotmath frac().  Is there a more elegant way to write a partial
> derivative?


See ?plotmath: There is "partialdiff"!

text(1.6, 1, expression(slope == frac(partialdiff * f(hat(theta)),
     partialdiff * hat(theta))))

Uwe Ligges




> dev.off()
> 
> plot(NA, xlim=c(-3,3), ylim=c(0,1.6), xlab="", ylab="", tck=-0.015)
> 
> text(1.6, 1, expression(paste("slope = ", frac(paste("   f( ",  hat(theta),
> " )"), hat(theta))), sep=""), adj=0)
> 
> text(2.25, 1.03, "\\pd", vfont=c("sans serif","plain"))
> 
> text(2.3, 0.934, "\\pd", vfont=c("sans serif","plain"))
> 
> 
> 
> Thanks.
> 
> 
> Charles Annis, P.E.
> 
> Charles.Annis at StatisticalEngineering.com
> phone: 561-352-9699
> eFax:  614-455-3265
> http://www.StatisticalEngineering.com
>  
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html



More information about the R-help mailing list