[R] Multiple plots question

Mark Wardle mark at wardle.org
Fri Mar 21 22:55:10 CET 2008


1. Work out what you want on the x and y scales from your data.
2. In your first call (to plot) set the xlim and ylim parameters to
the required range.

Good luck,

Mark


On 20/03/2008, Andre Nathan <andre at digirati.com.br> wrote:
> Hello
>
>  (Sorry if this appears twice, had some mail problems...)
>
>  I have a number of different data sets, each loaded as a matrix. I'd
>  like to plot them in a way that the data in the first column of each
>  matrix is plotted on the same pair of axes.
>
>  What I'm doing now is to call plot() for the data on the first matrix,
>  then call points() for the other ones. However, the axes are set by R
>  according to the data passed to plot(), and sometimes the data passed to
>  points() has larger values on the x axis, and the plot ends up being
>  "cut" (the y axis is not a problem since they're all probabilities).
>
>  Is there a way to dynamically adapt the axes so that all data can be
>  seen? I know I could build a new matrix with the columns I want to plot
>  but each matrix has 1 million rows, so I figure this would be
>  inefficient.
>
>  Do I have to check beforehand which column has the largest value and
>  call plot() on it, and then points() on the others, or is there an
>  automatic way to do this?
>
>  Thanks in advance,
>  Andre
>
>  ______________________________________________
>  R-help at r-project.org mailing list
>  https://stat.ethz.ch/mailman/listinfo/r-help
>  PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>  and provide commented, minimal, self-contained, reproducible code.
>
>
>  ______________________________________________________________________
>  This email has been scanned by the MessageLabs Email Security System.
>  For more information please visit http://www.messagelabs.com/email
>  ______________________________________________________________________
>


-- 
Dr. Mark Wardle
Specialist registrar, Neurology
Cardiff, UK



More information about the R-help mailing list