Legend wont display lines properly in figure window
1 回表示 (過去 30 日間)
古いコメントを表示
Hi im hoping someone can help please. Im using the following code to plot a graph with multiple data sets and include a legend however when opening in the figure window the legend displays as below and i cannot figure out how to solve it. it displays fine in the live editor but in wont in the figure window. thanks in advance :)
figure
plot(Time_Bundle1,y1,'r--',time_2,y2,'b--',time_3,y3,'k--', ...
time_4,y4,'m--',time_5,y5,'g--',time_6,y6,'c--')
lgd = legend({'Bundle','30% Opening','50% Opening', ...
'65% Opening','85% Opening','100% Opening'});
title(lgd,'Experiment','FontSize',10)
grid on
grid minor
title('Processed Results using logarithmic deterioration')
% xlim([0 250])
ylim([-7 0.5])
xlabel('Time (s)')
ylabel('log((T - T_{a})/(T_{m} - T_{a}))')
0 件のコメント
回答 (1 件)
VBBV
2022 年 4 月 17 日
lgd = legend('Bundle','30% Opening','50% Opening', ...
'65% Opening','85% Opening','100% Opening');
Use without a { }
2 件のコメント
VBBV
2022 年 4 月 17 日
ax = plot(Time_Bundle1,y1,'r--',time_2,y2,'b--',time_3,y3,'k--', ...
time_4,y4,'m--',time_5,y5,'g--',time_6,y6,'c--')
lgd = legend(ax,{'Bundle','30% Opening','50% Opening', ...
'65% Opening','85% Opening','100% Opening'});
Check using a function handle to plot function
参考
カテゴリ
Help Center および File Exchange で Legend についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!