Skip to content

Specifying line types

3 messages · Peter Dalgaard, Patrick Connolly

#
platform i686-pc-linux-gnu
arch     i686             
os       linux-gnu        
system   i686, linux-gnu  
status                    
major    1                
minor    6.1              
year     2002             
month    11               
day      01               
language R  

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?

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?

best
#
Patrick Connolly <p.connolly at hortresearch.co.nz> writes:
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.
Well, what you ended up doing is completely documented in help(par).

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.
#
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.

best