Drawing Tangent

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Drawing Tangent

Arun.stat
Dear all R-users,

I would like to draw a tangent of a given function for a particular (given)
point. However the straight line representing it should not cut any axis, it
should be a small line. Can anyone tell me how to do this?

Thanks,
Arun

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Drawing Tangent

Gregory Snow
There are several options depending on what exactly you want to do.

One option if you know the slope and intercept of your line is to use
the clipplot function from the TeachingDemos package with abline.

Or you could just choose 2 points on the tangent line and use either
lines or segments to connect the points.

--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
[hidden email]
(801) 408-8111
 
 

> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of Arun Kumar Saha
> Sent: Thursday, April 26, 2007 12:14 PM
> To: [hidden email]
> Subject: [R] Drawing Tangent
>
> Dear all R-users,
>
> I would like to draw a tangent of a given function for a
> particular (given) point. However the straight line
> representing it should not cut any axis, it should be a small
> line. Can anyone tell me how to do this?
>
> Thanks,
> Arun
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] 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.
>

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Drawing Tangent

Martin Maechler
In reply to this post by Arun.stat
>>>>> "Arun" == Arun Kumar Saha <[hidden email]>
>>>>>     on Thu, 26 Apr 2007 23:44:03 +0530 writes:

    Arun> Dear all R-users,
    Arun> I would like to draw a tangent of a given function for a particular (given)
    Arun> point. However the straight line representing it should not cut any axis, it
    Arun> should be a small line. Can anyone tell me how to do this?

You will eventually call segments() to draw that short line.

par("usr") {and maybe e.g. par("pin")} will probably be relevant when
determining how long the line segment(s) should be.

Martin Maechler, ETH Zurich

______________________________________________
[hidden email] 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.