I'm endeavouring to make a graph similar to the following using PgfPlots and TikZ.

Multiple y plots with labels on the left

I can make all of this work, except for the placement of the R=2, R=3, R=5, and R=10 markers on the left-hand side.

It would be nice if PgfPlots could place these automatically - any thoughts as to how? Alternatively, how could they be placed manually?


  • You can place them by adding node [pos=0] {$R=2$} at the end of your \addplot command. By default, they'll be clipped away, though, so you'll have to add clip=false to the axis options. – Jake Jul 18 '12 at 20:47
  • @Jake, that worked perfectly, except that I needed `node [pos=0,left] {$R=2$}. Please write up your comment as an answer. – Richard Jul 18 '12 at 21:14

You can place nodes along a plot by including node [pos=<fraction>] {<text>} at the end of the \addplot command, where pos=0 is the beginning and pos=1 is the end of the plot.

By default, objects that are defined as part of the \addplot commands are clipped at the axis boundaries, so your nodes would not be visible in this case. To disable the clipping, set clip=false in the axis options.

If you need the clipping, but still want to label your plots outside the axis boundaries, see PgfPlots with labeled plots extend outside the graph box for a (slightly hackish) alternative.

| improve this answer | |

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.