[R] making a plot

David Winsemius dwinsemius at comcast.net
Mon Oct 20 19:37:35 CEST 2014


On Oct 20, 2014, at 8:24 AM, Andrés Aragón wrote:

> Enrico,
> 
> This may help you:
> 
> text(locator(1), "*", cex=1.5,adj=0.5
> 
> and
> 
> text(locator(1), "º", cex=1.5,adj=0.5

Why not just use the values of x2 and  y2 that were given to segments:

> text( (ano+ranges)[1:3], 1:3, "*", cex=1.5,adj=0.5)
> text( (ano+ranges)[4:6], 4:6 , "º", cex=1.5,adj=0.5)

> 
> 
> Draw your plot, then write the code, locate the cursor on your plot, put
> the symbols where you want itl and click.
> 
> Regards,
> 
> 
> Andrés
> 
> PS ?locator
> 
> 
> 2014-10-20 9:46 GMT-05:00 Enrico Colosimo <enricoc57 at gmail.com>:
> 
>> Dear all,
>> 
>> I am struggling to make a plot for my survival analysis
>> class.
>> 
>> This is my script
>> 
>> 
>> labels<-c('1','2','3','4','5','6')
>> ano<-c(2001,2002,2003,2004,2006,2008)
>> ranges<-c(6,3,4,5,4,2)
>> dotchart(ano, labels=labels, xlab='ano',
>> ylab='Pacientes',pch=20,xlim=c(min(ano),  max(ano+ranges)))
>> segments(ano,1:6,ano+ranges,1:6,pch=25,lty=1,lend=4)
>> 
>> I need to put an asterix (failure) by the end of the three first lines and
>> a small circle (censoring)
>> by the end of the last three.
>> 
>> Someone can help me?
>> 
>> Thanks,
>> Enrico.
>> 
>>        [[alternative HTML version deleted]]
> 
-- 

David Winsemius
Alameda, CA, USA



More information about the R-help mailing list