[R] symbol in the plot

Johannes Graumann johannes_graumann at web.de
Fri Nov 20 17:02:41 CET 2009


plot(sigma, delta1, ylim=range(-0.5, 2), xlab='sigma', ylab='delta',pch=22, 
type='o')
points(sigma, delta2, col='red', axes=FALSE, pch=1,type='o')
legend("topleft",c(expression(Delta*1),expression(delta*2)),fill=TRUE,col=c("black","red"),pch=c(1,22))

See:
>?plotmath

Still, gimme a easily runnable example next time.

HTH, Joh

gcheer3 wrote:

> 
> Joh, thank you very much. sorry for confusing you. I didn't make my
> question
> clear.  I tried your code it looks much better than my original one. Just
> I prefer I can write the greek letter delta1 and delta 2 instead of words
> 'delta1' and 'delta2'. Also, it will be nice if there is a square symbol
> next to delta1 and a circle symbol next to delta 2, since sometimes I have
> to print the graph in a white and black paper. Thanks for any suggestions.
> Sorry for not asking question clearly.
> 
> 
> Johannes Graumann-2 wrote:
>> 
>> How about
>> 
>> plot(sigma, delta1, ylim=range(-0.5, 2), xlab='sigma', ylab='delta',
>> pch=22,
>> type='o')
>> points(sigma, delta2, col='red', axes=FALSE, type='o')
>> legend("topleft",c("Delta1","Delta2"),fill=TRUE,col=c("black","red"))
>> 
>> Send runnable example next time.
>> 
>> HTH, Joh
>> 
>> gcheer3 wrote:
>> 
>>> 
>>> TO be specific, here is how I graphed
>>> 
>>> 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')
>>> 
>>> Thanks a lot
>>> 
>>> 
>>> gcheer3 wrote:
>>>> 
>>>> a graph question. Thanks a lot in advance.
>>>> 
>>>> I made two scatterplots on one graph (sigma vs. delta1, sigma vs.
>>>> delta2)
>>>> (20 observations of delta1, delta2 and corresponding sigma) the x-axis
>>>> is
>>>> sigma, the y-axis is either delta1 or delta2. I connected both
>>>> scatterplots. To seperate them, one curves is a line with circles, the
>>>> other curve is a line with squares on it.
>>>> 
>>>> I want to make a notation either on the y-axis or on the graph. The
>>>> notiaion is "delta1--square; delta2--circle". So when people look at
>>>> the graph, they can easily tell each curve's meaning. The curve with
>>>> squares on it means the sigma vs. delta1, and the curve with circles on
>>>> it means sigma vs. delta2. I think I can use 'expression' to write
>>>> delta1, delta2 and sigma in greek letters, but I am not sure how to
>>>> denote the square and cirle I graphed.
>>>> 
>>>
>> 
>> ______________________________________________
>> 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.
>> 
>> 
>




More information about the R-help mailing list