[R] superscripts in xyplot labels

Martin Maechler maechler at stat.math.ethz.ch
Wed Jun 19 17:52:41 CEST 2002

>>>>> "YangR" == Yang, Richard <dyang at nrcan.gc.ca> writes:

    YangR> R-helpers;
    YangR> I tried to get a superscripted 3 in the following
    YangR> xyplot example but failed:

    >> data(whiteside)

    >> xyplot(Gas ~ Temp | Insul, whiteside, panel =
    YangR> function(x, y, ...) {
    YangR> panel.xyplot(x, y, ...)
    YangR> panel.lmline(x, y, ...)
    YangR> }, xlab = "Average external temperature (deg. C)",
    YangR> ylab = paste(paste("Gas consumption  (1000", expression(ft^3),")"), aspect
    YangR> = "xy",
    YangR> strip = function(...) strip.default(..., style = 1))

    YangR> It produces a label "Gas consumption (1000 ft^3)" for
    YangR> y axis insted of a superscipted 3 as in plot(). Any
    YangR> workaround to produce superscripts or subscripts for
    YangR> labels in xyplot()?

no easy workaround.
-- This is becoming a FAQ (hence CC to its maintainer) --

NO, currently you can't use any mathematical annotation as in
help(plotmath) when using ``grid'' graphics.  
Lattice is relying on grid entirely. 

    YangR> TIA,

    YangR> Richard

Martin Maechler <maechler at stat.math.ethz.ch>	http://stat.ethz.ch/~maechler/
Seminar fuer Statistik, ETH-Zentrum  LEO C16	Leonhardstr. 27
ETH (Federal Inst. Technology)	8092 Zurich	SWITZERLAND
phone: x-41-1-632-3408		fax: ...-1228			<><
r-help 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-help-request at stat.math.ethz.ch

More information about the R-help mailing list