Question: Explore command with multiple functions and legend

Hi,

I am using the following (dummy) code. I would appreciate any help generating a plot with multiple functions and a legend. I am getting an error message stating that the parameter "v" is unknown. I believe the issue is due to the complexity of the functions (fun1 and fun2) that use the "piecewise" command in my code.  

fun1 := piecewise(cond1, a(x,v), cond2, b(x,v))

fun2 := piecewise(cond1, c(x,v), cond2, d(x,v))

with(plots):
myPlotFunction := proc(v)
local p1, p2:
p1 := plot(fun1, x=0..1, color = [blue], linestyle = [solid], thickness = [3], legend = ["H"]):
p2 := plot(fun2, x=0..1, color = [red], linestyle = [dash], thickness = [3], legend = ["L"]):
plots:-display({p1, p2}, title="Multiple plots");
end proc:

Explore(myPlotFunction(v), parameter={v=0..1});

Regards,

Omkar
 

 

Please Wait...