Martin Maechler
1997-Sep-08 14:21 UTC
R-alpha: Re: lwd, cex and par(.) issues [was "... windows quirks .."]
[[yet another discussion brought from R-core to R-devel]]>>>>> "RG" == Robert Gentleman <rgentlem@stat.auckland.ac.nz> writes:RG> Peter, there is some code for line types and widths in all the RG> drivers. With windows there is the well known limitation that you RG> can't have patterened lines with lwd larger than 1 (unless you RG> write your own routines .... I just haven't had time). I do agree RG> that there is something very weird going on with our code though! RG> I think that in plot(1:4,lwd=2) the lwd should have absolutely RG> no effect. I think it's a bug in Splus that it does. For example, RG> plot(1:4,col="red") I agree, and I also have been hating this (Splus) behavior. I do prefer R's behavior have different 'col', 'cex', 'font' for axis, labs, and points/lines. After reading PD's reply to this message, I agree that "lwd" is somewhat different: If your device has too thin lines in general, it is nice if you can increase line width GLOBALLY. The same for "cex": There are situations where ALL text and plotting characters should just be made bigger with the same zoom factor. Below, you (RG) mention the use of par(lwd=...) {and correspondingly would be par(cex=...)}. Is this going to be ``the standard'': For global changes of linewidth or character size, one must use par(lwd=..) or par(cex=..) ? RG> gives you everything in red; axes, labels, lines and RG> points. That's wrong. In plot(1:4,type="l",lwd=2) lwd should RG> affect the width of the line joining the points but not the width RG> of the lines for the bounding box (IMHO). I agree, but again, it might be nice if there was something like a "global.lwd". RG> I think that if you want to change the line widths on the RG> bounding box you should use par(lwd=2) and then all lines are RG> changed. This seems to work (but I don't doubt there are bugs; we RG> simply have never had the chance to exercise everything). RG> As for character expansion- par cex seems to be the only route RG> (which makes me like my suggestion even more). RG> Opinions? It would be easy enough to mimic S but I do think RG> it's wrong. We should not mimic S here, sometimes. I agree it's wrong in some places. But if you use a different scheme, it should be - well documented - very consequently implemented ==> easily remembered by users -- Martin =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- r-devel 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-devel-request@stat.math.ethz.ch =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Ben Bolker
1997-Sep-08 14:36 UTC
R-alpha: Re: lwd, cex and par(.) issues [was "... windows quirks .."]
I agree with the gist of the discussion here ("par(lwd)" to change lwd globally, otherwise it just affects lines). One detail worth thinking about is that a global linewidth change in PostScript (setlinewidth) will also affect the linewidths used, e.g., in drawing plotting characters (which could get very ugly as a result). I'm glad to see folks are working on lwd; in my (alpha-2) version of R linewidth is mostly not implemented, and I was wondering whether I should dig in and work on it or whether I should wait 'til the prophesied Big Changes in the graphics code happened and the dust settled ... (For now, I've just been hacking the postscript _post facto_.) Benjamin Bolker Dep't of Ecology and Evolutionary Biology, ben@eno.princeton.edu Princeton University tel: (609) 258-6886, fax: (609) 258-1334 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- r-devel 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-devel-request@stat.math.ethz.ch =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-