[R] lines and legend

Ko-Kang Kevin Wang kwan022 at stat.auckland.ac.nz
Tue Jul 1 20:41:46 CEST 2003


Hi,

Have you specified the lty and/or col in legend?  For example, are the 
following codes work?
  plot(1:10, type = "n")
  lines(c(1, 10), c(1, 10))
  lines(c(1, 9), c(0, 10), col = "red")
  legend(8, 2, col = c("black", "red"), lty = 1, 
         legend = c("FOO", "FRED"))

On Tue, 1 Jul 2003, Anna  H. Pryor wrote:

> Date: Tue, 1 Jul 2003 11:23:55 -0700
> From: Anna  H. Pryor <anna at ptolemy.arc.nasa.gov>
> To: R-help mailing list <r-help at stat.math.ethz.ch>
> Subject: Re: [R] lines and legend
> 
> 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
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> 

-- 
Cheers,

Kevin

------------------------------------------------------------------------------
"On two occasions, I have been asked [by members of Parliament],
'Pray, Mr. Babbage, if you put into the machine wrong figures, will
the right answers come out?' I am not able to rightly apprehend the
kind of confusion of ideas that could provoke such a question."

-- Charles Babbage (1791-1871) 
---- From Computer Stupidities: http://rinkworks.com/stupid/

--
Ko-Kang Kevin Wang
Master of Science (MSc) Student
SLC Tutor and Lab Demonstrator
Department of Statistics
University of Auckland
New Zealand
Homepage: http://www.stat.auckland.ac.nz/~kwan022
Ph: 373-7599
    x88475 (City)
    x88480 (Tamaki)




More information about the R-help mailing list