TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. 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 delete empty space around graph automatically.my external picture is below graph without green box. I want delete this empty space green box automatically not by using xmax and xmin. enter image description here

share|improve this question

You want option enlargelimits = false, which turns off the automatic enlargement of the range.

The standard setting of enlargelimits is true, which will automatically enlarges adds a percentage on to the highest/lowest values for both x- and y-axes. I'm afraid I don't know what percentage gets added, but I think it's around 10%. So for example if the maximum x value in the input was 10, the x-axis upper limit would be 11. The over all result is to produce a 'border' around the material.

Setting enlargelimits = false means that pgfplots sets the limits to the maximum/minimum values in the input. So in my example, the plot would stop at exactly 10.

Other options are to have one limit automatic (settings upper and lower), or to do things on an axis by axis basis (for example using `enlarge x limits). This is covered in the pgfplots manual, page 216.

share|improve this answer
@sayros: The best way to thank people for their contribution is to upvote helpful answers (by clicking the upward-pointing triangle next to the answer) and marking the answer that actually solves your problem by clicking the tick mark next to it. This will give the answerer (and you) some reputation, and helps others to quickly find good answers. – Jake May 6 '12 at 23:23

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.