Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

This question already has an answer here:

I have created some simple code which generates a plot. This plot contains a family of curves created by changing a single parameter "k". I use the Table function within the Show function to iterate through the desired values of "k" which in turn creates the family of curves. The code and resultant plot is shown below:

ur[x_, a_] := 1 - (1/a)*Log[1 + a x]
g[x_, go_, s_, m_] := 1/2 (go*x*Exp[-(x/s)])/(1 + m x)

uh[x_, a_, go_, s_, m_, k_] := ur[x, a] + g[x, go, s, m]/(1 - g[x, go, s, m]) (k - 1)

(* initialize parameters *)
a = 5; go = 1; s = 2; m = 0.5; 

plt[k_] := ParametricPlot[{ uh[x, a, go, s, m, k], x}, {x, 0, 1}, 
           PlotRange -> {0.6, 1.4}, {0, 1.5}}, AspectRatio -> 1/1.5, 
           Frame -> True, PlotStyle -> {Darker[Green]}, 
           FrameLabel -> {Style["Normalized Volume", 16], 
           Style["Normalized Pressure", 16]},
           LabelStyle -> {FontSize -> 14, FontFamily -> "Times"}]

Show[Table[plt[k], {k, 1.0, 3.5, 0.5}]]

This is the created plot from the code above

The question is, "How do you create a plot with labeling generated by the Table function?" This question seems similar to another question recently asked, but I was not able to fold that solution into my code framework. The desired plot might look something like the following image... desired plot

Thank you in advance for any suggestions and/or comments.

share|improve this question
2  
Use the end coordinates of your plots to place appropriate Text , e.g. using Epilog or Show. –  Yves Klett May 7 '13 at 18:47
    
One might find an example here if you examine the answers: mathematica.stackexchange.com/questions/4444/… –  Artes May 7 '13 at 19:17
    
By "dynamically," do you really mean you want to place the labels programmatically based on the coordinates computed in Table? In Mathematica lingo, "dynamic" placement would usually be interpreted as "interactive" manipulation. –  Jens May 7 '13 at 23:38
    
I guess, "programmatically" is a better word than "dynamically". The desired result is to have the code make the approximate placement. I goofed with a poor word choice. –  Joseph May 8 '13 at 0:44
add comment

marked as duplicate by Yves Klett, m_goldberg, Jens, Mr.Wizard May 8 '13 at 3:30

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer

up vote 5 down vote accepted

You could add in a label function:

label[k_, x_] := Graphics@Text["k = " <> ToString[k], {uh[x, a, go, s, m, k], x}, {0, -1}];

Then show it all together:

Show[Table[{plt[k], label[k, 1]}, {k, 1.0, 3.5, 0.5}]]

labelled

share|improve this answer
    
Thank you for your help! This is what I needed. A function to programmatically place a label. Very Nice! I guess the question I asked was similar to other questions I just could not see a solution from the answers. I'm still learning. –  Joseph May 8 '13 at 16:00
add comment

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