Skip to content

Plotting functions on the same figure

3 messages · Volkan Kumbasar, Alexandre Brito, Peter Dalgaard

#
Hi there,
i am a newbie :P

My simple question is:
Is there command which is equal of the m*tl*abs `hold on` command.
In other words i want to plot 5 functions in the same figure.

Thanx,

volkan
#
see ?par
and the parameters mfrow, mfcol


----- Original Message ----- 
From: "Volkan Kumbasar" <volkan.kumbasar at linux-sevenler.org>
To: <r-help at stat.math.ethz.ch>
Sent: Saturday, May 21, 2005 1:07 PM
Subject: [R] Plotting functions on the same figure
#
Volkan Kumbasar <volkan.kumbasar at linux-sevenler.org> writes:
I wouldn't know exactly what `hold on` does. If you are plotting
functions using curve(), notice that you can set add=TRUE (but you do
have to get the xlim and ylim right on the first graph).

Otherwise, matplot() with type="l" could be the ticket. Or plot()
followed by lines().

The most drastic measure - and usually the wrong idea - is to set
par(plot.new=TRUE) to make the next plot believe that it doesn't need
to clear the screen (or advance the page as the case may be).
Obviously, you need to careful that the axes and titles are the same,
or suffer the consequences...