Jerome Asselin
2003-May-21 00:39 UTC
[Rd] axis() default values for "lty", "lwd", and "col"
Hi, I would like to recommend a minor modification in axis() which I believe can simplify the making of plots for publications. I am trying to define default values for par() in order to make labels bigger and lines thicker, so that the resulting plots look good when resized for publication purposes. I ran into the following problem... axis() does not use par() values as default for "lty", "lwd", and "col". Here is an example. par(lty=2,lwd=3,col="blue") plot(1,1,bty="n",axes=F) axis(1) axis(2) Because axis() doesn't use the par() values, I have to explicitely define the parameters "lty", "lwd", and "col" in my axis() calls. It would make sense if axis() used the par() values by default. Hence, I recommend this simple fix in the axis() function([...]) statement in order to have axis() read the par() values for "lty", "lwd", and "col". axis <- function (side, at = NULL, labels = TRUE, tick = TRUE, line = NA, pos = NA, outer = FALSE, font = NA, vfont = NULL, lty = par("lty"), lwd = par("lwd"), col = par("col"), ...) { [...] } I use R1.7.0 on Red Hat Linux 7.2. Sincerely, Jerome Asselin -- Jerome Asselin (J?r?me), Statistical Analyst British Columbia Centre for Excellence in HIV/AIDS St. Paul's Hospital, 608 - 1081 Burrard Street Vancouver, British Columbia, CANADA V6Z 1Y6 Email: jerome@hivnet.ubc.ca Phone: 604 806-9112 Fax: 604 806-9044
Prof Brian Ripley
2003-May-21 08:29 UTC
[Rd] axis() default values for "lty", "lwd", and "col"
I believe this to be deliberate. If I do par(lty=2,lwd=3,col="blue") plot(1:10) I do not want the axes to be thick, dotted and blue, with black labels. (It is also I suspect deliberate that plot(1:10,lty=2,lwd=3,col="blue") does not pass any of those parameters on to axis().) You say you made the labels bigger: to do that you needed to set cex.axis and cex.main, not cex. I'm afraid this change would break a lot of existing code. I am aware that S-PLUS does this (with blue labels too), and I have always found it irritating to have to work around it. On Tue, 20 May 2003, Jerome Asselin wrote:> I would like to recommend a minor modification in axis() which I believe > can simplify the making of plots for publications. I am trying to define > default values for par() in order to make labels bigger and lines thicker, > so that the resulting plots look good when resized for publication > purposes. I ran into the following problem... > > axis() does not use par() values as default for "lty", "lwd", and "col". > Here is an example. > > par(lty=2,lwd=3,col="blue") > plot(1,1,bty="n",axes=F) > axis(1) > axis(2) > > Because axis() doesn't use the par() values, I have to explicitely define > the parameters "lty", "lwd", and "col" in my axis() calls. It would make > sense if axis() used the par() values by default. > > Hence, I recommend this simple fix in the axis() function([...]) statement > in order to have axis() read the par() values for "lty", "lwd", and "col". > > axis <- > function (side, at = NULL, labels = TRUE, tick = TRUE, line = NA, > pos = NA, outer = FALSE, font = NA, vfont = NULL, lty = par("lty"), > lwd = par("lwd"), col = par("col"), ...) > { [...] } > > I use R1.7.0 on Red Hat Linux 7.2. > > Sincerely, > Jerome Asselin > >-- 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