필터 지우기
필터 지우기

Solving legend Problems in Matlab

조회 수: 1 (최근 30일)
Sayanta
Sayanta 2012년 9월 14일
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 ')

답변 (1개)

Oleg Komarov
Oleg Komarov 2012년 9월 14일
mesh(v)
mesh(probability)
You forgot a hold on in between.
  댓글 수: 2
Oleg Komarov
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
Oleg Komarov
Oleg Komarov 2012년 9월 14일
You have to specify the color option when plotting.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Legend에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by