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.

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?

Thanks!

share|improve this question
    
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
add comment

1 Answer

up vote 1 down vote accepted

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.

share|improve this answer
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.