1
$\begingroup$

I have created five lines in a plot.

Plot[Table[1 + (k - 1)*Sin[theta]^2, {k, 0, 2, 0.5}], {theta, 0, 
Pi/2}, PlotRange -> {{0, Pi/2}, {0, 2}}]

And I want to add five labels for them each other.I used PlotLabels \ such as this :

PlotLabels -> {"a=0", "a=0.5", "a=1.0", "a=1.5", "a=2.0"}

But I get a picture with only one label. I want to get fives of each other.

$\endgroup$
1

1 Answer 1

5
$\begingroup$
Plot[Evaluate@Table[1 + (k - 1)*Sin[theta]^2, {k, 0, 2, 0.5}], {theta, 0, Pi/2}, 
PlotRange -> {{0, Pi/2}, {0, 2}}, PlotLabels -> {"a=0", "a=0.5", "a=1.0", "a=1.5", "a=2.0"}]

enter image description here

In response to your comment,

Plot[Evaluate@Table[1 + (k - 1)*Sin[theta]^2, {k, 0, 2, 0.5}], {theta,
   0, Pi/2}, PlotRange -> {{0, Pi/2}, {0, 2}}, 
 PlotLabels -> {Subscript["I", 3]/Subscript["I", 1] == 0, "a=0.5", 
   "a=1.0", "a=1.5", "a=2.0"}]

enter image description here

$\endgroup$
1
  • $\begingroup$ That is great. But when I change "a" to "Subscript[I, 3]/Subscript[I, 1]", it does not work. How can I solve it? $\endgroup$
    – ch li
    Mar 16, 2019 at 14:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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