I just want to use something like .. controls .. in an addplot command. Unfortunately, the option "smooth" does not produce the image I desire. I haven't found it in the manual so far. The reason I'm not uusing tikz directly, is because i want to use the legend of pgfplots.

Any other ideas? If necessary I will post a MWE.

Edit: It is not really a MWE but i hope it helps. I couldn't use draw with controls in axis (even though I expressed the coordinates in the axis cs). The red "graph" is only shows how i want the blue line to be bend

 \addplot[blue,thick] coordinates

  \draw[red] (0,0) .. controls (0.2,0) and (0.8,1)
 .. (1,1);
  • 2
    A MWE is a very good idea. Feb 9, 2014 at 9:55
  • 1
    Maybe worth a look: Why should the minimal class be avoided?.
    – Tobi
    Feb 9, 2014 at 11:09
  • Thanks, the minimal class seems to cause lots of problems here, without it, I find the correct graph, though still obtaining some errors, which are probably due to a wrong coordinate system. (axis cs:0,0) seems to cause problems. Feb 9, 2014 at 11:23

1 Answer 1


You can access the coordinate system, which is used to plot functions by axis cs as in

\draw (axis cs:0,0) -- (axis cs:1,1);

For more on accessing axis coordinates in graphical elements, see section 4.17.1 on page 290 of the pgfplots manual.

        \addplot[blue,thick] coordinates {(0,0)(0.2,0)(0.8,1)(1,1)};
        \draw[red] (axis cs:0,0) .. controls (axis cs:0.2,0) and (axis cs:0.8,1) .. (axis cs:1,1);

enter image description here

  • thanks, essentially, the minimal document class caused the problems. Feb 9, 2014 at 21:40

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.