[R] Multiple plots

Ott Toomet siim at obs.ee
Thu Oct 10 09:13:35 CEST 2002


On Wed, 9 Oct 2002, Matej Cepl wrote:

  |Hi,
  |
  |I would love to make multiple histograms transposed one on another
  |in order to show relation between the sets. I tried to write
  |a function like this, but R tells me, that I cannot use add=FALSE in
  |high-level commands. That's nice but I am supposed to do?
  |
  |	rm(list=ls())
  |	# what's wrong with underscore?
  |        #getwd("/home/matej/docs/skola/stat\_anal-cj3534/assign01/")

On my system (linux, R 1.5.1), underscore seems to work in file names both
quoted and unquoted.

  |	load("assign01.RData")
  |
  |	postscript("assign01.eps",onefile=FALSE)
  |	plot(itg$WFemale,xlab="Number of victims",\
  |	ylab="Frequencies",col="blue",main="Intimate Homicide\
  |	Victims",type="l")
  |	plot(itg$WMale,add=FALSE,axes=FALSE,col="red",type="l")
  |	quit(save="no")


I think you are trying to plot to line-plots on the same graph.  If so, you
should use

plot(female...) # no add= here
lines(male....) # no add= here

lines is basically the same as plot(), but it does not erase the previous
picture.  

If your idea was indeed to make to separate plots, drop add= in both cases.

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help 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-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list