When plotting fast oscillating data from a table with pgfplots, an overshoot of the curve was observed (due to interpolation?). If the same data was plotted using Matlab, no overshoot occurred. The same phenomenon was observed when plotting a fast oscillating function, instead of data from a table. Here is the minimum working example, where a chirp signal sin(x^2) is displayed:

enter image description here


    ] {sin(x^2)};


The figure was compiled using PDFLaTeX, from the MiKTeX distribution. One can note that the curve overshoots 1 in absolute value, starting around the abscissa x=50. How to remove these spurious peaks?

  • 2
    They are called miters. They get longer for acute angles. – percusse Jul 4 '17 at 13:31
  • 4
    Add this after \usepackage{pgfplots}: \pgfplotsset{every axis/.append style={line join=round, line cap=round}} – AlexG Jul 4 '17 at 14:44

Browse other questions tagged or ask your own question.