Legend information is missing

I'm trying to plot a two y-axis graph as the following:
As you can see there is one plot missing in the legend. There should be a red square like the first one in the middle. I don't know why it is not appearing. All of the red information os the right axis. Below I show a sketch of my code:
For the fill graphs :
[ax p1 p2] = plotyy([Xaxis fliplr(Xaxis)],[Data_11' fliplr(Data_12')],[Xaxis fliplr(Xaxis)],
[Data12' fliplr(Data22_2')],@(X, Y) fill(X, Y, 'c'),
@(X, Y) fill(X, Y, 'r'));
For the lines:
[ax p1 p2] = plotyy([Xaxis' Xaxis'],[Curve11 Curve12],[Xaxis' Xaxis'],[Curve21 Curve22]);
As for the legend:
legend({'CI 95% - V','\overbar{V}',V','CI 95% - U','\overbar{U}',U'})
Matlab prints "Warning: Ignoring extra legend entries.".
Any thoughts?
Thanks!

回答(0 个)

类别

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by