我只想在 MATLAB 中显示一组数据的图例。
我想这样做的原因是我想将图例导出为 .eps,但我只想要图例,而不是情节。
有没有办法关闭绘图并将它们从图中移除,但仍然只显示居中的图例?
最佳答案
这似乎可以解决问题:
plot(0,0,'k',0,0,'.r') %make dummy plot with the right linestyle
axis([10,11,10,11]) %move dummy points out of view
legend('black line','red dot')
axis off %hide axis
图例周围可能有很多空白。您可以尝试手动调整图例的大小,或保存绘图并使用其他程序设置 eps 的边界框。
关于matlab - 我怎样才能在 MATLAB 中只显示图例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18117664/