I have two functions which I'd like to plot over different domains, and combine them into a single plot, with a legend included. If it weren't for the legend, I'd simply use Show
. However, I have issues with Mathematica's new ShowLegend
even in the most trivial case, so I'm not sure quite how to go about this. There are a few posts about using ShowLegend
within Show
but I had trouble making sense of them, and I'm wondering if my simple case, there's an easier way. An example that will suffice is
F[x_] := Sqrt[4 - x^2];
G[x_] := 9 - x^2;
Plot[F[x], {x, 0, 2}]
Plot[G[x], {x, 0, 3}]
with the resulting plot being over the full range {x, 0 ,3}
.
Plot[{f[x], g[x]}, {x, 0, 3}, PlotLegends -> "Expressions"]
$\endgroup$ShowLegend
: mathematica.stackexchange.com/a/100997/9490 $\endgroup$