Solving legend Problems in Matlab
조회 수: 1 (최근 30일)
이전 댓글 표시
Hello All,
I have problem with matlab legend entries. Legend entries in figure 1 and figure 2 having same colour .
I have warning message of
Warning: Ignoring extra legend entries. > In legend at 294 In Error_safe_look_ahead at 289
How can I resolve that problem any tips, I include the plot code
Thanks
h1=figure;
plot(h1,value_safelookahead_relerrorMarkov,'-X','LineWidth',2,...
'MarkerEdgeColor','b',...
'MarkerFaceColor','m',...
'MarkerSize',10)
axis([0 20 0 25])
xlabel('Safelook ahead Time')
ylabel('Relative Error of Usage')
title('Safelook ahead of usage ')
hold on ;
plot(value_safelookahead_relerrormaxFreq,'-+','LineWidth',2,...
'MarkerEdgeColor','r',...
'MarkerFaceColor','k',...
'MarkerSize',10)
plot(value_safelookahead_relstatefreqError,'-*','LineWidth',2,...
'MarkerEdgeColor','y',...
'MarkerFaceColor','b',...
'MarkerSize',10)
legend('safelookahead Markov','safelookahead maxFreq','Safelookahead StateFequency ');
h2=figure;
plot(h2,relerrorMarkov,'--sr','LineWidth',2,...
'MarkerEdgeColor','k',...
'MarkerFaceColor','g',...
'MarkerSize',10)
xlabel('Time Unit mins')
ylabel('Relative Error of Usage')
title('Predicted Relative Error of usage ')
hold on;
plot(relerrormaxFreq,'-ms','LineWidth',2,...
'MarkerEdgeColor','b',...
'MarkerFaceColor','c',...
'MarkerSize',10)
hold on;
plot(relstatefreqError,'-bs','LineWidth',2,...
'MarkerEdgeColor','y',...
'MarkerFaceColor','r',...
'MarkerSize',10)
legend('markov ','Max Freq',' State Freq Model');
h3=figure;
mesh(v)
mesh(probability)
hidden off
xlabel('State')
ylabel(' Time')
zlabel ('Probability Distribution')
title('Histrogram')
legend(' Predicted state',' Observed State ')
댓글 수: 0
답변 (1개)
Oleg Komarov
2012년 9월 14일
mesh(v)
mesh(probability)
You forgot a hold on in between.
댓글 수: 2
Oleg Komarov
2012년 9월 14일
COMMENT BY SAYANTA
Hi Oleg,
Thanks for reply. I used hold on, it's showing the legend but I still have problem with marker colour MarkerEdgeColor, MarkerFaceColor,
In all the figure MarkerEdgeColor and MarkerFaceColor having same colour instead of different colour for each MarkerEdgeColor and MarkerFaceColor for each plot.
How I resolve that problem
Many Thanks
참고 항목
카테고리
Help Center 및 File Exchange에서 Legend에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!