MathGroup Archive 2007

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

Search the Archive

Re: Re: version 6.0 Plot[___,Exclusions->Automatic]

  • To: mathgroup at smc.vnet.net
  • Subject: [mg76347] Re: [mg76312] Re: version 6.0 Plot[___,Exclusions->Automatic]
  • From: Murray Eisenberg <murray at math.umass.edu>
  • Date: Sun, 20 May 2007 02:27:21 -0400 (EDT)
  • Organization: Mathematics & Statistics, Univ. of Mass./Amherst
  • References: <f2k0a8$e3v$1@smc.vnet.net> <200705190846.EAA21320@smc.vnet.net>
  • Reply-to: murray at math.umass.edu

The combination of the default color for the "treads" and the specified 
Red for the "risers" of this multiple-step function hurts my eyes -- at 
least as displayed on my system!

Jens-Peer Kuska wrote:
> Hi,
> 
> with your definition
> ff[x_?NumericQ]:=Floor[2x]+0.1;
> 
> you hinder Mathematicas symbolic engine to take a
> look onto the discontinuities.
> 
> If you say
> ff[x_] := Floor[2 x] + 0.1;(*Define a numeric function*)
> 
> Plot[
>   Evaluate[ff@x], {x, 0, 4}, ExclusionsStyle -> Red]
> 
> or
> 
> Plot[ff@x, {x, 0, 4}, ExclusionsStyle -> Red, Evaluated -> True]
> 
> it work as expected.
> 
> Regards
>    Jens
> 
> 
> Lev Bishop wrote:
>> 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
>>
> 

-- 
Murray Eisenberg                     murray at math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower      phone 413 549-1020 (H)
University of Massachusetts                413 545-2859 (W)
710 North Pleasant Street            fax   413 545-1801
Amherst, MA 01003-9305


  • Prev by Date: Re: Re: 64-bit again
  • Next by Date: Re: Re: Re: 6.0 not seeing style sheets in $InstallationDirectory/SystemFiles/FrontEnd/StyleSheets
  • Previous by thread: Re: version 6.0 Plot[___,Exclusions->Automatic]
  • Next by thread: Integrate[Log[a]+...+O[a]^n,x]