[英]Change position of legend in octave
I want to display a legend below or right of multiple subplots, while keeping the aspect ratio of the subplots. 我想在多个子图的下方或右侧显示图例,同时保持子图的长宽比。 Trying the approach of this answer , I wrote the following code: 尝试此答案的方法,我编写了以下代码:
x = [0:0.1:10];
figure();
for i=1:4
subplot(3,2,i);
plot(x, x);
endfor;
hSub = subplot(3,2,5:6);
plot(0);
hLegend = legend('1');
set(hLegend, 'position', get(hSub, 'position'));
which produces: 产生:
The legend should replace the full plot 5. I couldn't find the property position
at the octave documentation , so it's obviously not working. 图例应该替换整个图5。我在octave文档中找不到属性position
,因此显然不起作用。
Is there a way to change the legends position or another approach for printing the legend next to the subplots? 有没有一种方法可以更改图例的位置,或者可以使用其他方法在子图旁边打印图例?
edit: 编辑:
gnuplot
, fltk
and qt
graphics_toolkit:使用gnuplot
, fltk
和qt
测试
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.