保存的图例框不显示其中一行
Saved plot legend box does not display one of the lines
我正在 Matlab 中绘图并将其保存为 jpeg 图像。问题是保存的图像没有显示完整的框(如果我把框放在绘图 space 之外,就会发生这种情况)。这是我正在使用的代码,我没有显示任何错误。有什么建议么??。谢谢。
fig1 = figure;
plot(n6C(:,1),n6C(:,2),'o-','MarkerIndices',1:10:length(n6C))
hold on
plot(n6(:,1),n6(:,2),'*-','MarkerIndices',1:10:length(n6C))
hold on
plot(n6B(:,1),n6B(:,2),'v-','MarkerIndices',1:10:length(n6C))
hold off
legend('Test 0.5mm','Test 2mm','Test 3mm','location','northeastoutside')
grid on
title('Wind velocity');
xlabel('Time (s)');
ylabel('Velocity (m/s)');
saveas(fig1,'Vel.jpeg')
生成的情节:
我过去在 saveas
遇到过很多这样的问题。如果您使用的是 R2020a 版本,我建议您改用 exportgraphics
。
我正在 Matlab 中绘图并将其保存为 jpeg 图像。问题是保存的图像没有显示完整的框(如果我把框放在绘图 space 之外,就会发生这种情况)。这是我正在使用的代码,我没有显示任何错误。有什么建议么??。谢谢。
fig1 = figure;
plot(n6C(:,1),n6C(:,2),'o-','MarkerIndices',1:10:length(n6C))
hold on
plot(n6(:,1),n6(:,2),'*-','MarkerIndices',1:10:length(n6C))
hold on
plot(n6B(:,1),n6B(:,2),'v-','MarkerIndices',1:10:length(n6C))
hold off
legend('Test 0.5mm','Test 2mm','Test 3mm','location','northeastoutside')
grid on
title('Wind velocity');
xlabel('Time (s)');
ylabel('Velocity (m/s)');
saveas(fig1,'Vel.jpeg')
生成的情节:
我过去在 saveas
遇到过很多这样的问题。如果您使用的是 R2020a 版本,我建议您改用 exportgraphics
。