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

I want to set a zero offset for the frame origin. In other words, the horizontal axis should start at exactly the lower bound, instead of having a small offset.

For example, in the figure below, even though I set the range of x to be [0, 6], the x axis starts at a small negative value. What do I need to do to make the x axis start at exactly 0?

Plot[Sin[x], {x, 0, 6}, Frame -> True, FrameLabel -> {x, y}, 
 RotateLabel -> True, PlotLegend -> {"a=1"}, 
 LegendPosition -> {0.3, 0.3}, LegendSize -> 0.5, 
 LegendShadow -> None, LegendBorder -> None]

enter image description here

share|improve this question
Add the option PlotRangePadding -> 0? – David Park Aug 15 '13 at 15:56
@DavidPark even if the solution is trivial, it is useful, so why not post an answer? I would also not vote for closure, but that is subjective. – Yves Klett Aug 15 '13 at 16:00
@DavidPark Great. Thanks! – Patrick Li Aug 15 '13 at 16:06
This is one of those "easy to find in documentetion" issues but if you now what to look for :) – Kuba Aug 15 '13 at 16:24
up vote 12 down vote accepted

This is just to illustrate that the PlotRange and the padding on the Frame are independent of the domain of the Plot function.

Plot[Sin[x], {x, -1, 10},
 PlotRange -> {{0, 2 \[Pi]}, {-1, 1}},
 PlotRangePadding -> 0,
 Frame -> True,
 FrameTicks -> {{Automatic, Automatic}, {Range[0, 2 \[Pi], \[Pi]/2], 

enter image description here

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.