Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2001

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: How to remove, change the assymptotic lines?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg28779] Re: How to remove, change the assymptotic lines?
  • From: "Allan Hayes" <hay at haystack.demon.co.uk>
  • Date: Sat, 12 May 2001 20:18:12 -0400 (EDT)
  • References: <9dg5f8$j3f@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

DeleteVerticals[gr_Graphics, slopeMax_]:=
 gr/.Line[lst_] :>
      Module[{xmin,xmax,ymin,ymax,ar,scl},
        (*get the plot range and the aspect ratio used*)
        {{{xmin,xmax},{ymin,ymax}},ar} =
          Last/@AbsoluteOptions[gr,{PlotRange,AspectRatio}];
        (*
          multiplying by scl converts a slope in user coordinates to the \
slope as seen - see note below*)
        scl=    ar (xmax-xmin)/(ymax-ymin);
        Map[Line,
             Split[lst,Abs[Divide@@ Reverse[#1 -#2]] scl <slopeMax &],
          1]];


Note: we have scl(ymax-ymin)/(xmax-xmin) = ar .

The  technique can also  be used to style the steep segments rather than
remove them.


EXAMPLE

gr1=Plot[Tan[x], {x, -2Pi, Pi}];

Show[DeleteVerticals[gr1, 200],Frame\[Rule]True]

--
Allan
---------------------
Allan Hayes
Mathematica Training and Consulting
Leicester UK
www.haystack.demon.co.uk
hay at haystack.demon.co.uk
Voice: +44 (0)116 271 4198
Fax: +44 (0)870 164 0565

"Jose Capco" <jcapco at mathematik.uni-ulm.de> wrote in message
news:9dg5f8$j3f at smc.vnet.net...
> Dear NG,
>
> I wish to plot the tangent function, but when I use
Plot[Tan[x],{x,-Pi,Pi}], I
> get the function with solid assymptotic line. Is there any way I could
remove
> or change the assymptotic lines?
>
> Sincerely,
> Jose Capco
>






  • Prev by Date: Re: Converting {{a,b},{c,d}} to just {a,b},{c,d} (no enclosing parens) ?
  • Next by Date: Re: How to make curved arrows?
  • Previous by thread: Re: How to remove, change the assymptotic lines?
  • Next by thread: How to make curved arrows?