I am working on plotting data from an external file. When I use the following code I get the points in the curve joined with lines, however I would like to join them using smooth curves.

    grid style={dashed,gray!30},
    \addplot table [col sep=tab, x=a, y=b] {results/test_data.dat};
    \addplot table [col sep=tab, x=a, y=c] {results/test_data.dat};
\caption{Test Plot}

This is the plot I have.

Following is the expected curve:

This is the plot I want

Also I cannot increase or decrease the number of data points. Since these are experimental data.

Can anyone suggest me how to achieve this ? I am new to using latex.

  • Related (duplicate?): tex.stackexchange.com/q/109457/2552 – Jake May 24 '16 at 14:26
  • I guess its a different scenario here. I want the smooth curve to be passing through all the data points ( As shown in expected picture which is made in excel sheet ). Also I tried using smooth with \addplot but did not achieve anything. – sravan kumar May 24 '16 at 14:39
  • 1
    The smooth option should work in that case. Could you turn your example into a minimal compilable document (starting from \documentclass and including some dummy data). – Jake May 24 '16 at 14:42
  • 1
    @sravankumar: I've written an answer. It includes a minimal compilable document, that is a short but complete .tex document that includes all the necessary parts (a documentclass, the packages, and example data) to reproduce the problem. – Jake May 24 '16 at 21:48

You can use the smooth option in the \addplot +[...] options to smooth the curve.



\addplot +[smooth] table [x=a, y=b] {
a b
50 410
80 390
120 405
150 430
180 445
210 455
240 440
270 415

  • Works perfectly :) .. Thank you very much for your help jake :) – sravan kumar May 25 '16 at 8:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.