0
$\begingroup$

How can I remove the labels of some of the curves in Plot? For example in the following plot, how can I remove labels for the first two curves? (removing MSC=0 and MSC=0.06 and keep the rest.)

gamma4 = .4; gamma3 = .284; gamma2 = .265; gamma1 = .484; z3 = 10000; \
z2 = 32000; z1 = 75000; zbar4 = 4800; zbar3 = 20050; zbar2 = 46200;
zbar1 = 138100; h4 = .301; h3 = .404; h2 = .25;
h1 = .045; p1 = 3.89; p2 = 4.92; p3 = 5.22;
p4 = 5.39;

g1 = 0;
g2 = 0.44;
g3 = 0.88;
g4 = 1.76;


Clear[\[Tau]2]

Cost2 = (g2 + 
      MSC (g1 p1 h1 + g2 p2 (h2 - 1) + g3 p3 h3 + 
         g4 p4 h4)) h2 (zbar2 - z2) + (g1 + 
      MSC (g1 p1 (h1 - 1) + g2 p2 h2 + g3 p3 h3 + g4 p4 h4)) h1 (z1 - 
      z2) - (MSC (g1 p1 h1 + g2  p2 (h2 + (1 - \[Tau]2)/\[Tau]2) + 
        g3 p3 h3 + g4 p4 h4)) h2 zbar2 gamma2 (\[Tau]2/(1 - \[Tau]2));
Gain2 = h2 (zbar2 - z2) + h1 (z1 - z2) - 
  h2 zbar2 gamma2 (\[Tau]2/(1 - \[Tau]2))


d7 = Show[
  Plot[Evaluate@Table[Cost2, {MSC, {0,  0.06, 1, 2, 100}}], {\[Tau]2, 
    0, 1}, PlotRange -> {{0, 0.15}, {0, 11000}}, 
   PlotRangePadding -> {{0, 1}, {0, 0}}, 
   PlotLabels -> 
    Placed[Table[
      StringForm["MSC\n=``.", MSC1], {MSC1, {0, "", 1, 2, 100}}], 
     Top]]]
$\endgroup$
1
$\begingroup$

This will do:

d7 = Show[
  Plot[Evaluate@Table[Cost2, {MSC, {0, 0.06, 1, 2, 100}}], {\[Tau]2, 
    0, 1}, PlotRange -> {{0, 0.15}, {0, 11000}}, 
   PlotRangePadding -> {{0, 1}, {0, 0}}, 
   PlotLabels -> 
    Placed[{"", ""}~Join~
      Table[StringForm["MSC\n=``.", MSC1], {MSC1, {1, 2, 100}}], 
     Top]]]
$\endgroup$
1
  • 1
    $\begingroup$ One would think that {None,None} instead of {"",""} would also work, but it does not, becuase Placed does not respect None, though it probably (?) should. $\endgroup$ – Rolf Mertig Oct 4 '17 at 20:35

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.