When I am trying to put a legend on a plot where I am using "lines", R just ignores it. I can do it with boxplot or plot, but just not with lines. Am I doing something wrong? Maybe I am just making a mistake? Anna
Yes, I am using plot and then lines. The legend is just not appearing. I am using the coordinates of the legend (150,4) which work on boxplot and plot. I have not looked at the output of par (I don't know how to) to see if they are in the region. I assumed if they worked for plot and boxplot they would also for lines. Anna On Tuesday 01 July 2003 11:16, you wrote:> I assume that you are calling 'plot' and then 'lines'. Is the legend just > not appearing? what are you using for the coordinates of the legend? Have > you looked at the output from "par" to see if these values are within the > plot region? > __________________________________________________________ > James Holtman "What is the problem you are trying to solve?" > Executive Consultant -- Office of Technology, Convergys > james.holtman at convergys.com > (513) 723-2929 > > > > "Anna H. Pryor" > <anna at ptolemy.arc.nas To: R-help mailing > list <r-help at stat.math.ethz.ch> a.gov> cc: > Sent by: Subject: [R] lines and > legend r-help-bounces at stat.m > ath.ethz.ch > > > 07/01/2003 13:45 > > > > > > > When I am trying to put a legend on a plot where I am using "lines", R just > > ignores it. I can do it with boxplot or plot, but just not with lines. Am > I > doing something wrong? Maybe I am just making a mistake? > > Anna > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Anna, I found this quite useful in positioning a legend: plot(1:10, 1:10) legend(locator(1), "A legend") Now, go to the plot window and click your left mouse where you want the upper left corner of the legend to appear. Ithink, this should work no matter what your coordinate system is. Hope this helps, Andy __________________________________ Andy Jaworski Engineering Systems Technology Center 3M Center, 518-1-01 St. Paul, MN 55144-1000 ----- E-mail: apjaworski at mmm.com Tel: (651) 733-6092 Fax: (651) 736-3122 |---------+--------------------------------> | | "Anna H. Pryor" | | | <anna at ptolemy.arc.nas| | | a.gov> | | | Sent by: | | | r-help-bounces at stat.m| | | ath.ethz.ch | | | | | | | | | 07/01/2003 12:45 | | | | |---------+--------------------------------> >-----------------------------------------------------------------------------------------------------------------------------| | | | To: R-help mailing list <r-help at stat.math.ethz.ch> | | cc: | | Subject: [R] lines and legend | >-----------------------------------------------------------------------------------------------------------------------------| When I am trying to put a legend on a plot where I am using "lines", R just ignores it. I can do it with boxplot or plot, but just not with lines. Am I doing something wrong? Maybe I am just making a mistake? Anna ______________________________________________ R-help at stat.math.ethz.ch mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Fred, [from help on pairs() ]: ... Arguments: x: the coordinates of points given as columns of a matrix. So yes, pairs will do what you ask. See ?pairs for more info. Also you might consider the alternative function from the lattice package: > library(lattice) #load lattice graphics package > ?splom #help for splom() Which is called differently using a formula interface. HTH G Feng Zhang wrote:> Hey, R-listers > > I am going to plot a scatter-plot matrix using R. > For example, give a matrix X=[x1, x2, ..., xn] > where each xi is a column vector, how to plot > all the pair scatter-plots between two different > xi and xj? > > Is PAIRS able to achieve this function? > > Thanks for your help. > > Fred > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > >-- %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~% Gavin Simpson [T] +44 (0)20 7679 5522 ENSIS Research Fellow [F] +44 (0)20 7679 7565 ENSIS Ltd. & ECRC [E] gavin.simpson at ucl.ac.uk UCL Department of Geography [W] http://www.ucl.ac.uk/~ucfagls/cv/ 26 Bedford Way [W] http://www.ucl.ac.uk/~ucfagls/ London. WC1H 0AP. %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%