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

My plots look blocky. Is it possible to increase the number of points PGFplots uses when plotting a graph from a formula?

share|improve this question

The samples axis setting lets you do this:

\begin{axis}[samples=15,xmin=0,xmax=360,ymin=-1, ymax=1]
  \addplot+[domain=0:360,mark=none] {sin( x )};

Looks blocky:

enter image description here

Upping samples to samples=65 looks quite a bit smoother for this zoom level:

enter image description here

share|improve this answer
+1. For simple functions like this, you can also add the smooth option, then you don't need as many samples. This can introduce unwanted artifacts with more complicated functions, though. – Jake Feb 4 '13 at 17:54

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.