如何在MATLAB中为4个子图创建一个通用图例,如下所示:
答案 0 :(得分:2)
又快又脏:
hSub = subplot(3,1,1); plot(1,1,1,1,1,1,1,1);
hLegend = legend('hello','i','am','legend');
subplot(3,2,3), plot(10:-1:1); subplot(3,2,4), plot(1:100);
subplot(3,2,5), stem(1:10); subplot(3,2,6), plot(randn(1,100))
set(hLegend, 'position', get(hSub, 'position'));