1
$\begingroup$

I'd like to mark a region in my plot and after some research in the internet I found the solution I was looking for using the Filling option.

f1 [x_] := Sin[x]

f2 [x_] := Cos[x]

lb := -.4

ub := .3

f1[0]

f2[0]

Plot[ { lb, f1[x], f2[x]}, {x, 0 - Pi, Pi}, 
 PlotStyle -> Join[ {None}, ColorData[97, "ColorList"]], 
 Filling -> {1 -> {ub, LightBlue}}, PlotLegends -> {"Sin", "Cos"}]

The result is here

enter image description here

As you can see, the label "Sin" has no color and "Cos" has the color of "Sin" (because Cos[0]=1.0). Any ideas?

Thanks, Jörg

$\endgroup$
2
$\begingroup$

Use

PlotLegends -> {None, "Sin", "Cos"}

enter image description here

| improve this answer | |
$\endgroup$
  • $\begingroup$ Perfect. Stupid me. $\endgroup$ – osx Aug 21 '19 at 6:45

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