Re: [R] lwd less than 1

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Thu 19 May 2005 - 17:11:04 EST

On Thu, 19 May 2005, Jacques VESLOT wrote:

> Thank you for helping,
>
> Actually, lwd=.5 in plot() or par() brings neither error nor warning message,
> but lwd below 1 seems not to be taken into account, as plot(..., lwd=1) and
> plot(..., lwd=.5) look quite the same.

On what device: see below?

> Besides, it is mentioned in the lwd section of the par() help page :
> " (...) some devices do not implement line widths less than one".

(The people who write the documentation do tend to know what it says: you omitted `The interpretation is device-specific' and it seems did not look in the device-specific documentation.)

This _is_ documented under both ?postscript and ?pdf as

      Line widths as controlled by 'par(lwd=)' are in multiples of
      1/96inch.  Multiples less than 1 are allowed.  'pch="."' with 'cex
      = 1' corresponds to a square of side 1/72 inch.

You haven't mentioned the device (or version of R) you are using, nor the commands used nor how you are viewing the output.

I checked the sources: the quartz() device is restricted to lwd >= 1, so this might have resulted from plotting on that and then copying the plot.

> What I am looking for is how to get readable plots (with not too wide lines)
> after size reduction...

Using postscript() or pdf() directly works for me, and the code is the same on all R platforms.

> Paul Murrell a écrit :
>>
>> Jacques VESLOT wrote:
>>
>>> Someone, who uses R under Mac, wants to insert a couple of small plots
>>> (each with several lines) in an article, but he has to reduce plots' size
>>> significantly. He did it (in pdf or enc. ps) but, unfortunately,
>>> everything is reduced but lines' width. Besides, 'lwd' argument in par()
>>> or plot() can't be less than one.
>>
>> IANAMU (I am not a Mac user) either, but you should definitely be able to
>> set lwd to less than 1. What happens when you try par(lwd=.5) or
>> plot(1:10, type="l", lwd=.5)?

>>> I am not a Mac user and I don't know whether it is a Mac-related problem
>>> or not.
>>>
>>> Could somebody please give me a way to solve this problem, either to
>>> reduce line width under R, or to get reduced lines' width when reducing
>>> plot size ?

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Received on Thu May 19 17:16:00 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:51 EST