par(mkh) {was [R] Plot Character Sizes in rw-0.90.0}

Martin Maechler maechler at stat.math.ethz.ch
Thu Dec 2 09:38:30 CET 1999


    PD> John Maindonald <john.maindonald at anu.edu.au> writes:

      JM>      <....>

      JM> A further point is that, contrary to the documentation of par(),
      JM> the setting of mkh seems to have no effect on the height of symbols
      JM> plotted with pch, e. g.  plot(1:4,1:4,pch=1,mkh=0.2)

    PD> Yes, I believe we already have a bug report to that effect.

True; question is : What should be fixed?  Documentation or implementation?

Here the Status:

   Contrary to S, in R, we have always been using  par("cex") and the
   <highlevel plot> cex argument  *both* for text and all graphical symbols.
   S uses mkh for  pch=<integer>   symbols and
	  cex for  pch=<character> ones and text
   which is really not what we (R&R, initially) wanted to copy.

   In R, mkh settings have always been completely ignored.  
   In spite of this, par() (and the internal code in  par.c & graphics.c) have
   been set up to allow setting and querying mkh.

Now, there are several possibilities of which I'd advocate mainly 1) or 2) 
[I'm talking about implementation; documentation must be updated in any case]:

1) Implementation unchanged + using  mkh gives a warning saying 
   that mkh is practically ignored.
   
2) setting par(mkh) or  <highlevelplot>(* , mkh = ..)
    
    gives a warning (``mkh : setting cex'')
    and then behaves as if "cex" was used.

3a) Even more S compatibility:
   Setting par(mkh) or  <highlevelplot>(* , mkh = ..)
   changes "cex" accordingly *IF* pch=<numeric> .

3b) Similar but more logical; need some "notation" : 
    The symbol size used in the core function plot.xy()  is
           cexbase * Pcex   (--> plot.c, l.1089)

    where "cexbase" is par("cex") and  Pcex is the "cex" argument of 
    plot(),points(),...

    Now we could change this to
           cexbase * mkh * Pcex
    for the case of numeric pch (internally pch <= 31 or something) where
    mkh is *either* par("mkh") or the mkh arg. of plot.xy().


4) complete S compatibility (cex *not* working for pch=<numeric>)

   This is completely out of question for me!


Martin Maechler <maechler at stat.math.ethz.ch>	http://stat.ethz.ch/~maechler/
Seminar fuer Statistik, ETH-Zentrum  LEO D10	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