[R] symbol in the plot

David Winsemius dwinsemius at comcast.net
Fri Nov 20 16:52:14 CET 2009


On Nov 20, 2009, at 10:23 AM, gcheer3 wrote:

>
> Thanks for your reply.  It is very helpful. I am sorry I didn't make  
> my
> queston clearer.
> I have two concerns about this graph.
> One thing is denote 'sigma' and 'delta' as greek letters, usually I  
> use
> 'expression'. But I don't know how to use 'expression' in the 'legend'
> The other thing is, the graph will also be print out with black and  
> white. I
> try to use circle and squre to seperate 'delta1's curve and  
> 'delta2's curve.
> So even someone read the black and white handout, they can tell  
> which graph
> is which.  It will be nice if there is a notation on the graph, next  
> to a
> square symble, it says 'delta 1', next to a circle symble, it  
> says'delta 2'.
> I wrote it on the label with phrases, looks not professional.
>
> Thank you for any suggestons.
>
> my runable code is as follows:
>
> sigma=c( 0.00625, 0.06250, 0.12500, 0.18750, 0.25000, 0.31250,  
> 0.37500,
> 0.43750, 0.50000,
> 0.56250)
> delta1=c(0.90768, 0.90489, 0.901788,0.898681, 0.8955, 0.89557,
> 0.892474,0.88936, 0.886262, 0.179959)
> delta2=c(0.90830, 0.9110998, 0.914203, 0.917308, 0.920412, 0.923517,
> 0.926623, 1.71524, 1.7153, 1.7154)
>
> plot(sigma, delta1, ylim=range(-0.5, 2), xlab='sigma', ylab='delta1-- 
> square
> delta2--circle', pch=22, type='o')
> par(new=TRUE)
> plot(sigma, delta2, ylim=range(-0.5, 2), xlab='sigma', ylab='delta1-- 
> square
> delta2--circle', col='red', axes=FALSE, type='o')

legend("topleft",legend=expression(Delta~1, Delta~2),  
col=c("black","red"), pch=c(22,1) )

(I think I got the order of hte red and circle correct. You should  
check.)

-- 
David.


David Winsemius, MD
Heritage Laboratories
West Hartford, CT




More information about the R-help mailing list