Hi, I've been struggling to get separate figures in one .mlx file. When I specify a figure(x) with hold on/hold off commands, and then start a new figure(x+i) with hold on/hold off, the later figure overlays the earlier one. Here is some sample code to illustrate my issue:
figure(1);
hold on
yyaxis left
title('plot 1')
plot(x,NH2O,'DisplayName','H2O','linewidth',2.0)
xlabel('x/L','fontsize',14,'fontweight','b','fontname','arial')
ylabel('H2O','fontsize',14,'fontweight','b','fontname','arial')
yyaxis right
plot(x,N1,'k-','linewidth',2.0)
plot(x,N2,'linewidth',2.0)
plot(x,N3,'linewidth',2.0)
ylim([0 inf])
ylabel('N','fontsize',14,'fontweight','b','fontname','arial')
legend('H2O','1','2','3')
xlim([0 1])
ylim([0 1])
hold off
figure(2);
hold on
title('plot 2')
xlim([0 1])
ylim([0 15])
xlabel('x/L','fontsize',14,'fontweight','b','fontname','arial')
ylabel('H2O','fontsize',14,'fontweight','b','fontname','arial')
plot(x,N1a, 'linewidth',2.0)
plot(x,N2a, 'linewidth',2.0)
hold off