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
  • Subject: [mg28779] Re: How to remove, change the assymptotic lines?
  • From: "Allan Hayes" <hay at>
  • Date: Sat, 12 May 2001 20:18:12 -0400 (EDT)
  • References: <9dg5f8$>
  • Sender: owner-wri-mathgroup at

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

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

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


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

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

Allan Hayes
Mathematica Training and Consulting
Leicester UK
hay at
Voice: +44 (0)116 271 4198
Fax: +44 (0)870 164 0565

"Jose Capco" <jcapco at> wrote in message
news:9dg5f8$j3f at
> 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
> 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?