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

You can see that there are gaps on all sides of the plot between the frame and the extent of the line that I've plotted. How do I get rid of these? I'd like the frame to cover $[0,1]\times[0,1]$ and no more.

Plot[x, {x, 0, 1}, Frame -> True]

enter image description here

share|improve this question
One way is to specify PlotRange as in Plot[x, {x, 0, 1}, Frame -> True, PlotRange -> {{0, 1}, {0, 1}}]. – b.gatessucks Jan 31 '13 at 12:57
@b.gatessucks This also works; thanks! – Will Vousden Jan 31 '13 at 13:22
up vote 8 down vote accepted
Plot[x, {x, 0, 1}, Frame -> True, PlotRangePadding -> 0]

Mathematica graphics

The key to the solution was PlotRangePadding -> 0.

share|improve this answer
Whoops, I missed that. I was looking for options relating to Frame. Thanks! – Will Vousden Jan 31 '13 at 13:21
@Will I understand; there are a lot of options, especially for plotting and graphics. – Mr.Wizard Jan 31 '13 at 13:29

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.