Skip to content
Back to formatted view

Raw Message

Message-ID: <Pine.LNX.4.44.0305030803490.6453-100000@gannet.stats>
Date: 2003-05-03T07:12:42Z
From: Brian Ripley
Subject: can't plot ylab in graph
In-Reply-To: <Pine.LNX.4.44.0305022248550.29823-100000@Chrestomanci>

On Fri, 2 May 2003, Faheem Mitha wrote:

> I am sure I am missing something obvious as usual, but in the following
> graph I can't plot ylab.
> 
> Ignoring unimportant details, I am plotting one instance of truehist() and
> one instance of curve() on the same graph. Truehist() won't let me pass
> the ylab argument. It gives me the error
> 
> Error in plot.default(xlim, c(0, ymax), type = "n", xlab = xlab, ylab =
> "",  : formal argument "ylab" matched by multiple actual arguments
> 
> I don't understand the error. I looked at the help page for truehist().
> The xlab argument was present but the ylab argument was missing.

Right, so why do you think it accepts `ylab'?  There seems to be a crop of
people asking questions or sending bug reports who think `xlab' and `ylab'
are graphical parameters, but that are actually arguments to title() which
plot.default passes through.

What you can do is call title(), as in

library(MASS)
truehist(rnorm(100))
title(ylab="some y label")

-- 
Brian D. Ripley,                  ripley at 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