[R] par('mgp')

Patrick Connolly P.Connolly at hortresearch.co.nz
Fri May 11 05:27:03 CEST 2001


According to Paul Murrell:
|> 
|> Hi
|> 
|> 
|> > P.S.  I didn't get any reaction to my proposal to have
|> > x- and y-axis specific par('mgp') parameters when
|> > par(las=1).  I hope that R-core will consider that.
|> 
|> 
|> My take on this is as follows ...
|> 
|> Doing this would make par() more complex and ...
|>     (i) par() is quite complex already
|>     (ii) there is no end to the number of parameters we could put in par()
|> to control specific aspects such as axis label locations.
|> 
|> I think that a better approach in this sort of case is to use a lower-level
|> tool to obtain greater control.  In this particular case, axis() or mtext()

I had become used to using that approach using Splus because the
default par values were not often very useful.  I even have a function
I call blank.plot that does nothing more than set up the plotting
area.  I then do the rest using lines, points, axis, text, mtext, box
and a few more rather like what Paul describes.  Different plotting
devices have different default par settings which adds to the
complexity.  Rarely does the same mgp value suit x and y axes.  To use
axis, one first has to specify yaxt = "n" (and probably xaxt = "n") in
the plot call.  It does seem a bit silly to use a vector of length 3
to change only one value.  Separate xmgp and ymgp would be
considerably simpler.

I use in my work a function to make breaks in the y-axis. It has a
y.mgp and a x.mgp parameter.  The latter is defined as the amount the
second element of mgp for the x-axis is smaller than for the y-axis
(and with different defaults depending on the device being used).  The
function looks too complicated for general distribution.

In R, I was pleased to notice that there is more flexibility in the
par settings such as the different cex values.  I don't think it
clutters, and there is room for a few more carefully named parameters.
I'm inclined to agree with Frank's idea, preferring xmgp and ymgp to
changing the length of mgp which is too much of a paradigm shift.

For publication quality plots, I would probably continue to use the
lower level tools as in the past, but it would be useful to get
something halfways decent with less tinkering.  

|> 
|> Happy to hear opposing arguments  :)

Opposing they might be, but they're not mutually exclusive.

best

-- 
*************************************************************
Patrick Connolly
HortResearch                        Great minds discuss ideas;
Mt Albert                           Average minds discuss events; 
Auckland                            Small minds discuss people.
New Zealand                                                 .... Anon
Ph: +64-9 815 4200 x 7188
*************************************************************


______________________________________________________
The contents of this e-mail are privileged and/or confidential to the
named recipient and are not to be used by any other person and/or
organisation. If you have received this e-mail in error, please notify 
the sender and delete all material pertaining to this e-mail.
______________________________________________________
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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