[R] Specifying line types

Patrick Connolly p.connolly at hortresearch.co.nz
Mon Nov 18 01:56:08 CET 2002

On Sun, 17-Nov-2002 at 11:36PM +0100, Peter Dalgaard BSA wrote:

|> Patrick Connolly <p.connolly at hortresearch.co.nz> writes:
|> > I wish to make a vector of line types something like c("21", "32")
|> > which is simple enough to do.  But if I want to have a continuous line
|> > part of that vector, I'd have thought "40" would produce a blank space
|> > of zero length thereby achieving the desired effect.  Not so.
|> > 
|> > Even less predictable is if I try "A0".  The result seems to be
|> > similar to specifying "A8" (approximately).  Is that by design?
|> The source is available...
|> It says that (assuming we're talking about the x11 device) "0" is
|> solid and any other 0-nybbles (= half-bytes, hex digits) are converted
|> to "1" to prevent X11 from falling over.

I neglected to say that it was the postscript device I was referring
to.  The "A0" == "A8" phenemonon does not happen with x11.  It seems
to be more like "A0" == "AA", and not "A1" which I'd understand from
that explanation.

|> > It's no surprise that lty = 1 cannot mix with lty = "32" but in the
|> > end, I discovered that c("21", "32", "solid") will do what I want,
|> > though it wasn't obvious.
|> > 
|> > Is something lacking in the documentation or just in my comprehension?
|> Well, what you ended up doing is completely documented in help(par).

Complete maybe, but not obvious.  The par help indicates two ways of
specifying lty using integars or character strings, and then gives an
"Alternative" customized way.  Nothing indicates that the second of
the standard ways can be combined with the "Alternative" method.  Easy
once you know though (like everything).

|> The page might be clearer that 0-nybbles are undesirable, and if
|> any behaviour is driver-specific, the help page for the device should
|> probably say something about it.

The behaviour is quite different on X11 and postscript, that's for
sure, so that probably should be indicated.  When I understand exactly
how it works, I'll offer to clarify the help file.


Patrick Connolly
Mt Albert
New Zealand 
Ph: +64-9 815 4200 x 7188
I have the world`s largest collection of seashells. I keep it on all
the beaches of the world ... Perhaps you`ve seen it.  ---Steven Wright 
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