Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

A very common feature of graphs of functions used throughout textbooks are simple indications, such as open circles, of the points at which a function is undefined. Is there a way to do this in Mathematica?

I understand that I can use Epilog (or Prolog, or other explicit drawing graphics functions) to "manually" draw these elements, but us there a way to automatically do this, or at least return the coordinates of such points for use as arguments to Epilog?

share|improve this question
up vote 22 down vote accepted

By using Exclusions and ExclusionsStyle like this

Plot[1/Sin[π x], {x, -3, 3},
  Exclusions -> Sin[π x] == 0, 
  ExclusionsStyle -> {Thin, Directive[Red, PointSize[0.02]]}

you can define the location of the discontinuities and the style for poles and discontinuity boundaries, respectively.

Exclusionsstyle example image

Also the Wolfram Blog, March 2011 has more examples on this topic.

share|improve this answer
Why won't this work with Sin[x]/x, {x, -10, 10}, Exclusions -> {0}? – raxacoricofallapatorius Jan 17 '12 at 21:46
actually, i don't know. But in this case you can get a more consistent result by specifying the points to be excluded by an implicit equation: Exclusions -> Sin[\[Pi] x]==0. I'll update the answer accordingly. – Thies Heidecke Jan 17 '12 at 21:56
@raxacoricofallapatorius: In that case I would use Exclusions->x == 0. – Mike Bailey Jan 18 '12 at 0:38
@raxacoricofallapatorius - note that an exclusion is not necessary if you use Sinc[x] rather than Sin[x]/x. – Bob Hanlon Feb 21 '15 at 18:18
@BobHanlon: Yes, but that's not the question. – raxacoricofallapatorius Feb 21 '15 at 19:58

You can use the ExclusionsStyle option to control how Mathematica renders regions excluded from the Plot.

Edit Doing something like ExclusionsStyle -> {None, {{Black, PointSize[Large]}}} will put a large point at the excluded points. For example, modifying a function from the help documentation:

Mathematica graphics

share|improve this answer
As near as I can tell, that simply changes how that segment of the graph is drawn (e.g. by omitting a single pixel in the figure), and provides no way to "exaggerate" the relevant points so they can be clearly seen. – raxacoricofallapatorius Jan 17 '12 at 21:36
I've updated with another option. The second entry in that options list sets the boundary style for the exclusion. – Eli Lansey Jan 17 '12 at 21:38

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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