Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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

1 Answer 1

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
1  
@Will I understand; there are a lot of options, especially for plotting and graphics. –  Mr.Wizard Jan 31 '13 at 13:29

Your Answer

 
discard

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.