Question: how to add legend to display?

August 19 2014 nm 605

0

According to help here  on display, it says "The options parameter can include plot options as described in the plot/option "  and when  I go to the plots/option I see legend there. But when I try to use it, I get an error that plots:-display does not accept the legened option.

I am generating 2 plots, and use display() to show them on one axes. But need to add a legend as well. Is there a correct way to do this? 

restart:
with(DynamicSystems):
with(plots):
sys := TransferFunction(1/(s^2+0.2*s+1)): 
p1:=ResponsePlot(sys, Step(),duration=50,color=red):
p2:=ImpulseResponsePlot(sys,50);
display([p1,p2],axes=boxed, title=`step and impulse reponses`,legend=["step","impulse"]);

Now if I add legend, it fail

display([p1,p2],axes=boxed, title=`step and impulse reponses`,legend=["step","impulse"]);

I am sure I am doing something wrong. How to add legend to display? I can't use plot([...]) since the plots are allready generated by other Maple functions.

 

 

Please Wait...