0

I am trying to use plotlegend for solutions I've obtained using NDSolve. I have

Plot[{a[z], b[z]} /. sol , {z, 0, L}, PlotLegends -> {"1", "2"}]

It doesn't work because I am using ./sol

How can I fix this?

Thanks in advance...

rami_salazar
  • 372
  • 1
  • 8
  • The documentation seems to indicate Evaluate is required. Does Plot[Evaluate[{a[z], b[z]}/.sol], {z, 0, L}, PlotLegends -> {"1", "2"}] work? – MassDefect May 03 '19 at 15:53

1 Answers1

2

Evaluate the list first:

Plot[Evaluate[{a[z], b[z]} /. sol] , {z, 0, L}, PlotLegends -> {"1", "2"}]
Turgon
  • 1,040
  • 8
  • 15