matlab - 如何在 MATLAB 中为 4 个子图创建一个通用图例?

标签 matlab legend subplot

如何在 MATLAB 中为 4 个子图创建一个通用图例,如下所示:

enter image description here

最佳答案

快速而肮脏:

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'));

enter image description here

关于matlab - 如何在 MATLAB 中为 4 个子图创建一个通用图例?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26704815/

相关文章:

r - 在 map 上独立移动 2 个图例 ggplot2

python - 如何在 Matplotlib 中排列嵌套子图?

Python - 使用 matplotlib 组织 3 个子图

matlab - fft(DFT) x 轴的单位

algorithm - 从大型文本文件快速形成矩阵

r - 禁用图例双击事件

python Bokeh 调色板图例

python - Plotly:如何使用分组图例设置多个子图?

检测给定图像中正方形数量的算法

matlab - 在 Matlab 中创建并绘制时间序列数据