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

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
add comment

1 Answer

The samples axis setting lets you do this:

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

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
6  
+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
add comment

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.