[R] Adding key to simple plot() function

Paul Murrell p.murrell at auckland.ac.nz
Mon May 31 04:22:48 CEST 2004


Hi

The text() function has a "pos" argument for positioning labels "beside" 
(x,y) locations.

Do you know about the legend() function for creating a key?

Paul


Laura Quinn wrote:
> I already tried this but encountered a number of problems - firstly the
> point labels overlie the actual points meaning the labels are
> unreadable..and I was hoping to have a separate key within which to
> describe the labels, is this feasible?
> 
> 
> 
> On Fri, 28 May 2004, Sean Davis wrote:
> 
> 
>>Laura,
>>
>>For your axis issues, look at plotting without axes [plot(....,axes=F) and
>>then see ?axis for making them on your own.  As for labeling your data, look
>>at ?points and ?text.
>>
>>Sean
>>
>>On 5/28/04 8:27 AM, "Laura Quinn" <laura at env.leeds.ac.uk> wrote:
>>
>>
>>>I am generating a simple x,y plot to show geographical positions where
>>>point data has been taken. Rather than plot a graph and lay points on top
>>>I've opted to generate the map from the point data, ie plot(-x,-y). This
>>>works fine, though I am wanting to label each point 1:20 and have a key
>>>alongside - is this possible without getting into trellis plots? I have
>>>very limited time available so don't want to embark on trellis functions
>>>which I've never used before..
>>>
>>>Also, my x,y  labels currently have a negative sign in front of them which
>>>I'd like to remove, but if I negate the labels they no longer fit on the
>>>graph as my data points are -x and -y...
>>>
>>>Any suggestions?
>>>
>>>Thanks,
>>>Laura
>>>
>>>______________________________________________
>>>R-help at stat.math.ethz.ch mailing list
>>>https://www.stat.math.ethz.ch/mailman/listinfo/r-help
>>>PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>>>
>>
>>
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


-- 
Dr Paul Murrell
Department of Statistics
The University of Auckland
Private Bag 92019
Auckland
New Zealand
64 9 3737599 x85392
paul at stat.auckland.ac.nz
http://www.stat.auckland.ac.nz/~paul/




More information about the R-help mailing list