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

Would someone mind showing me how to plot a floor function with the appropriate endpoints? I tried Google, but the best I could find was something posted from 2004 that no longer appears to work.

Sorry if this is overly basic, I've only got a couple of weeks of experience with Mathematica and no one to work with on it.

Edit: I'm looking to create a graph similar to the one shown on the wiki page for floor/ceiling functions. I'm not too concerned with the frame or the tick marks.

share|improve this question
You just need to add Exclusions -> None to your plot command. Also, the documentation covers this very example – R. M. Sep 26 '12 at 0:40
up vote 10 down vote accepted

To plot $\lfloor x\rfloor$ you can use DiscretePlot at the integers with ExtentSize and ExtentMarkers:

DiscretePlot[Floor[x], {x, 0, 8}, ExtentSize -> Right, 
 ExtentMarkers -> {"Filled", "Empty"}, Filling -> None]

enter image description here

share|improve this answer
Sadly this doesn't work on v7, which explains why I haven't used these options before. :-/ – Mr.Wizard Sep 26 '12 at 2:58
@Mr.Wizard Yes, the Extent* options were added in V8. – Brett Champion Sep 26 '12 at 3:07

From the help:

Plot[Floor[x], {x, 0, 10}, ExclusionsStyle -> {Red, Blue}]

Mathematica graphics

share|improve this answer

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.