Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1995
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1995

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

Search the Archive

Re: Plotting Piecewise Functions with Discontinuites

  • To: mathgroup at christensen.cybernetics.net
  • Subject: [mg1985] Re: [mg1974] Plotting Piecewise Functions with Discontinuites
  • From: Allan Hayes <hay at haystack.demon.co.uk>
  • Date: Mon, 4 Sep 1995 22:22:41 -0400

CORRECTION:

Please replace "max"  and  "min"  in the third line of the code  
with  "a"  and  "b"  respectively to get:

PlotNA[f_,{x_,a_,b_},n:(_Integer?Positive):25, opts___?OptionQ] :=
Module[ {graph,ar,graphNA,pairs},
   graph = Plot[f, {x,a,b}, DisplayFunction->Identity,opts];
   ar = Divide@@Reverse[FullOptions[graph,PlotRange].{-1,1}];
   graphNA =
      graph/.Line[lst_] :>
	 (pairs = Partition[lst, 2, 1];
	 Cases[pairs,
	     p_/;Greater@@(Abs/@(Subtract@@p){n ar,1}):>Line[p]
	  ]
	);
   Show[graphNA, DisplayFunction -> $DisplayFunction]
]

Allan Hayes
De Montfort University Leicester
hay at haystack.demon.co.uk




  • Prev by Date: WordPerfect
  • Next by Date: Help reduce this expression (Not Long)
  • Previous by thread: WordPerfect
  • Next by thread: Help reduce this expression (Not Long)