Re: Plotting w/o artifacts at discontinuities
- To: mathgroup@smc.vnet.net
- Subject: [mg12558] Re: Plotting w/o artifacts at discontinuities
- From: fgomez@pie.xtec.es (Fernando Gsmez Lanza)
- Date: Sat, 23 May 1998 18:11:19 -0400
- Organization: The Math Forum
- References: <6i0ukg$8pb@smc.vnet.net>
About discPlot
note that
discPlot[func_, {x_, xmin_, xmax_}, opts___] :=
Module[{poles, ranges, nbr, p},
poles = x /. Solve[1/func == 0, x];
ranges =
({x, #1[[1]], #1[[2]]} & ) /@
Partition[Flatten[{xmin,
Select[poles, xmin < #1 < xmax & ], xmax}], 2, 1];
nbr = Length[ranges];
Table[p[k] =
Plot[func, Evaluate[ranges[[k]], opts],
DisplayFunction -> Identity], {k, nbr}];
Show[Table[p[k], {k, nbr}],
DisplayFunction -> $DisplayFunction]; ];
fails with trigonometric functions as, Tan[x], and non-polinomial
functions. Item 0209-382 solve this problem.