version 6.0 Plot[___,Exclusions->Automatic]
- To: mathgroup at smc.vnet.net
- Subject: [mg76257] version 6.0 Plot[___,Exclusions->Automatic]
- From: "Lev Bishop" <lev.bishop at gmail.com>
- Date: Fri, 18 May 2007 06:24:21 -0400 (EDT)
Mathematica version 6.0 has a nice feature in it's Plot[] function that automatically looks for discontinuities so it can draw them in ExclusionsStyle. You can explicitly set the Exclusions option for functions of your own that Plot[] cannot find the discontinuities in (eg, because they only evaluate for ?NumericQ). I couldn't find a documented method for doing this but, the following seems to work: ff[x_?NumericQ]:=Floor[2x]+0.1; (*Define a numeric function *) Plot[ff@x,{x,0,4},ExclusionsStyle->Red](*Plot[] doesn't know where the discontinuities are*) Visualization`DiscontinuityDump`Discontinuities[ff[x_],z_]:=Visualization`DiscontinuityDump`Discontinuities[Floor[2x],z]; (* ff[x] has the discontinuities at the same places as Floor[2x]*) Plot[ff@x,{x,0,4},ExclusionsStyle->Red] (*Now it works*) Plot[Sin@ff@Cos@x,{x,0,4},ExclusionsStyle->Red](*Even in more complex cases*) Hope that's useful to someone, Lev