[R] Graphing question(basic)

R. Michael Weylandt michael.weylandt at gmail.com
Tue Aug 14 22:50:01 CEST 2012


On Tue, Aug 14, 2012 at 2:39 AM, Mohan Radhakrishnan <mohanr at fss.co.in> wrote:
>
> Apology. Will investigate ?segments. But this is simpler than that ?
>
>
> think<-20
>
> xc<-c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
> 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
> 34, 35, 36, 37, 38, 39, 40)
> yc<-c(2.2, 2.28454054054054, 2.37536982774792, 2.47313421094031,
> 2.5785575746323, 2.6924505136953, 2.8157201615705, 2.94938049983818,
> 3.09456286072372, 3.25252617706843, 3.42466633005651, 3.61252368944728,
> 3.8177876360978, 4.0422965148466, 4.28803111715535, 4.55709949144067,
> 4.85171070979966, 5.17413530104881, 5.5266505359318, 5.91146976820772,
> 6.33065670052978, 6.78602775401095, 7.27904848896425, 7.81073282553444,
> 8.38155598805605, 8.99139286720872, 9.63949219065441, 10.3244932533533,
> 11.0444863687371, 11.7971117346767, 12.5796855744434, 13.3893386735135,
> 14.2231516747487, 15.0782737166279, 15.9520153622441, 16.8419119612243,
> 17.7457583253788, 18.6616190047916, 19.5878202092552, 20.5229296995423
> )
>
> plot(xc, yc, type="l", ylim=c(0,50), xlim=c(0,50), lwd=2, xlab="M",
> ylab="seconds")
> abline(a=-20, b=1.00, lty="dashed",  col="red")
> abline( 2.2, 0, lty="dashed",  col = "red")
>

# Segments is the way if I understand your original request
segments(-4, 2.2, 1, 2.2, lty = 1, lwd = 2, col = "green4")
>
> Thanks,
> Mohan
>
> -----Original Message-----
> From: R. Michael Weylandt [mailto:michael.weylandt at gmail.com]
> Sent: Tuesday, August 14, 2012 11:49 AM
> To: Mohan Radhakrishnan
> Cc: r-help at r-project.org
> Subject: Re: [R] Graphing question(basic)
>
> Hi Mohan,
>
> Your code isn't reproducible as is: see
>
> http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reprodu
> cible-example
>
> for more information on how you can help us help you.
>
> That said, I think you are looking for the ?segments function.
>
> Cheers,
> Michael
>
> On Tue, Aug 14, 2012 at 2:13 AM, Mohan Radhakrishnan <mohanr at fss.co.in>
> wrote:
>> Hi,
>>
>>
>>
>> plot(xc, yc, type="l", ylim=c(0,50), xlim=c(0,50), lwd=2, xlab="M",
>> ylab="seconds")
>>
>> abline(a=-think, b=cpustime, lty="dashed",  col="red")
>>
>> abline( 2.2, 0, lty="dashed",  col = "red")
>>
>>
>>
>> This draws a response time curve an asymptote and a horizontal line.
> How
>> do I draw a line from the intersection of the asymptote and the
>> horizontal to intersect the y-axis ? I also want to calculate the
> value
>> at this y-axis intersection point.
>>
>>
>>
>> Thanks,
>>
>> Mohan
>>
>>
>>
>> DISCLAIMER:\ ===============...{{dropped:31}}
>>
>> ______________________________________________
>> 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.
>
>
> DISCLAIMER:\ ===============...{{dropped:30}}
>
> ______________________________________________
> 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