4
$\begingroup$

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?

$\endgroup$
  • $\begingroup$ Exclusions inner workings aren't trivial. See for example mathematica.stackexchange.com/a/10502/193 $\endgroup$ – Dr. belisarius Feb 12 '15 at 17:39
  • $\begingroup$ I believe the quick answer is that Exclusions needs to return a Boolean. $\endgroup$ – David G. Stork Feb 12 '15 at 17:46
  • 1
    $\begingroup$ 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. $\endgroup$ – Szabolcs Feb 12 '15 at 18:20
  • 1
    $\begingroup$ 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. $\endgroup$ – Bob Hanlon Feb 12 '15 at 21:02
  • $\begingroup$ I did report this to Wolfram. $\endgroup$ – David Feb 12 '15 at 23:00
1
$\begingroup$

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

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.