4

Bug introduced in 9.0 or earlier and fixed in 11.0.0


Consider this code:

f[x_]:=(6 + 4 x + x^2 - x^3)/(x-2)
Plot[f[x], {x, -10, 10},
Exclusions -> {2},
ExclusionsStyle -> Directive[Red, Dashed]]

It produces this image.

enter image description here

Note that the vertical exclusion is removed, but it is not styled with a red, dashed line. On the other hand, this works.

f[x_]:=(6 + 4 x + x^2 - x^3)/(x-2)
Plot[f[x], {x, -10, 10},
Exclusions -> {-2 + x == 0},
ExclusionsStyle -> Directive[Red, Dashed]]

enter image description here

How come?

David
  • 14,883
  • 4
  • 44
  • 117
  • Exclusions inner workings aren't trivial. See for example http://mathematica.stackexchange.com/a/10502/193 – Dr. belisarius Feb 12 '15 at 17:39
  • I believe the quick answer is that Exclusions needs to return a Boolean. – David G. Stork Feb 12 '15 at 17:46
  • 1
    According to the documentation, Exclusions -> 2 is not correct syntax. However, Exclusions -> {2} is. Both cause the exclusion to appear but none will work with styling. Exclusions -> {x==2} works with styling. This looks like a bug to me and I'm tagging it as such. Can you please report to Wolfram and let us know what they said? In the bug report I would reference the Exclusions -> {2} syntax as this is clearly documented. – Szabolcs Feb 12 '15 at 18:20
  • 1
    I am guessing that the function is f[x_] = (x + 1)^2 (x - 3)/(2 - x);; however, you should includes its definition in your question. – Bob Hanlon Feb 12 '15 at 21:02
  • I did report this to Wolfram. – David Feb 12 '15 at 23:00
  • And I got this response from Wolfram feedback: Hi David,

    Thanks for your message and for taking the time to send in the invaluable feedback. Indeed this is a wrong behaviour of Exclusions. Our developers are aware of the issue and are working to resolve it. I will keep you informed if any updates on this topic.

    Thanks again for bringing the issue to our attention, most appreciated.

    – David Feb 16 '15 at 17:30

1 Answers1

1

For reference, this is what it looks like on 11.0.1.

enter image description here

rcollyer
  • 33,976
  • 7
  • 92
  • 191