How can I choose to show only part of plot/legend?
Show older comments
I want to show only one of the "Maxvärde" in the legend.

The code that we used to plot it was:
figure(1);
hold on;
plot(MedelV,'b');
plot(find(Vattenh==(Max)),(Max), 's','MarkerSize',10,'MarkerEdgeColor','k','MarkerFaceColor', 'r');
plot(find(Vattenh==(Min)),(Min), 's','MarkerSize',10,'MarkerEdgeColor','k','MarkerFaceColor', 'y');
plot(Tjugofemperc,'c');
plot(Sjuttiofemperc,'c');
plot(Damnplot,'r');
plot(Sankplot,'r');
plot(x,Vattenh,'k');
lgnd=legend(['Medelvattenstånd ', num2str(Mean, prec),'m'],['Maxvärde ', num2str(Max,prec),'m'],['Maxvärde ', num2str(Max,prec),'m'],['Maxvärde ', num2str(Max,prec),'m'],['Maxvärde ', num2str(Max,prec),'m'],['Minvärde ', num2str(Min,prec),'m'],['25%-percentilen ', num2str(Tjugofem,prec),'m'], ['75%-percentilen ', num2str(Sjuttiofem,prec),'m'],['Dämningsgräns ', num2str(Damn, prec),'m'],['Sänkningsgräns ', num2str(Sank, prec),'m'],'Vattenståndsdata');
rect=[0.63, 0.18, .25, .25];
set(lgnd,'color','none', 'position', rect);
set(gca,'XTick',[0:4:52])
xlabel('Tid i veckor för 2010')
ylabel('Vattenstånd (möh)')
title('Statistiska data för medelvattenståndet i Högsjön under år 2010')
How is this possible??
Accepted Answer
More Answers (1)
Katarina
on 8 May 2014
0 votes
Categories
Find more on Legend in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!