Line marker specifiers duplicated - subplot legend
显示 更早的评论
I am using subplots (3X4) in a figure. I have 9 plots which means in the third row, plots 10, 11, and 12 are free. I am trying to put my legend in the space of plot 10. Could anyone explain why there are some extra symbols creeping in between (shown inside the red circle in picture)? The relevant part of my code is as follows:
subplot(3,4,10)
axis off
plot(p1, 'ks', 'MarkerEdgeColor','k', 'MarkerFaceColor','w','MarkerSize',8);
axis off
plot(p2, 'ko', 'MarkerEdgeColor','k', 'MarkerFaceColor','k','MarkerSize',5);
hold on;
axis off
plot(p3, 'k^', 'MarkerEdgeColor','k', 'MarkerFaceColor','w','MarkerSize',7);
hold on;
axis off
plot(p4, 'k^', 'MarkerEdgeColor','k', 'MarkerFaceColor','k','MarkerSize',7);
hold on;
axis off
plot(p5, '-k', 'MarkerEdgeColor','k', 'MarkerFaceColor','k','MarkerSize',2);
hold on;
axis off
plot(p6, '--k', 'MarkerEdgeColor','k', 'MarkerFaceColor','k','MarkerSize',2);
hold on;
legend(...
'abc',...
'abc',...
'abc',...
'abc',...
'abc',...
'abc',...
'Location', 'North');
legend('boxoff')
title('Legend')

采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Legend 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!