Does anyone know why the second plot doesn't work?
4 次查看(过去 30 天)
显示 更早的评论
Hello everyone,
doesn anyone know why in the third plot don't appear the data present in the previous plot?
In the third plot should appear the data present in the first and second plot.
Thank you!
0 个评论
采纳的回答
Star Strider
2021-7-25
Yes!
In line #44, there is a
hold off
call, although no new figure call, so the subsequent plot overplots the existing plot. The second plot is the only plot that displays because of that.
I am not absolutely certain, however this may be what you want:
%DA PLOTTARE
LD = load('Pul MODESTAMMEQ.mat');
MODESTAMMEQ = LD.MODESTAMMEQ;
dv = regexp(MODESTAMMEQ.Jan1989, '\d*\-\w*\-\d*','match');
MODESTAMMEQ.Var1 = datetime([dv{:}], 'InputFormat',"dd-MMM-yyyy").';
x = MODESTAMMEQ.Var1;
y = MODESTAMMEQ.Var2*10*0.35;
figure
plot(x, y)
grid
xlabel('Time');
ylabel('Height(mm)');
title('MODESTA Mmeq')
%ADDING--> FIRST PLOT
% load('MODESTA_MMEQ_STAKES');
load('Pul MODESTA_PALINE_DELTA');
errorbar(x,MODESTAMMEQ.Var5(:,1),MODESTAMMEQ.Var4(:,1),'.r','MarkerSize',6)
hold on
plot(x,[y, MODESTAMMEQ.Var5(:,1)]);
hold on
xlabel('Time');
ylabel('Height(mm)');
title('Modesta AWS and Stakes')
xlabel('Time');
ylabel('Height(mm)');
title('Modesta AWS and Stakes')
%2ND PLOT
load('Pul MODESTA_PALINE_DELTA');
errorbar(x(5432:6513,1),MODESTAMMEQ.Var5(5432:6513,1),MODESTAMMEQ.Var4(5432:6513,1),'.r','MarkerSize',6);
errorbar(x(7639:10569,1),MODESTAMMEQ.Var5(7639:10569,1),MODESTAMMEQ.Var4(7639:10569,1),'.b','MarkerSize',6);
errorbar(x(10570:11265,1),MODESTAMMEQ.Var5(10570:11265,1),MODESTAMMEQ.Var4(10570:11265,1),'.m','MarkerSize',6);
% plot(x,[y, MODESTAMMEQ.Var5(:,1)],'g')
plot(MODESTAMMEQ.Var1(:,1),y);
hold off
xlabel('Time');
ylabel('Height(mm)');
title('Modesta AWS and Stakes')
% plot(x,[y, MODESTAMMEQ.Var5(:,1)],'g');
% xlabel('Time');
% ylabel('Height(cm)');
% title('Modesta AWS and Stakes');
load('Pul DATI_MAR_ANNUALI');
load('Pul DATA_ECM');
%MODESTA(MP) --> THIRD PLOT
% plot(T.Year(:,1),[NEW, T.Var4(:,1) T.Var5(:,1)],'g');
figure
hold on
plot(MODESTAMMEQ.Var1(:,1),[y, MODESTAMMEQ.Var5(:,1)], 'g' , 'DisplayName','AWS')
plot(datetime(DATIMARannuali.Year,1,1), DATIMARannuali.SMB_priestleymm,'--co', 'MarkerEdgeColor','k','MarkerFaceColor','c', 'DisplayName','ECMWF');
plot(datetime(DATIECMWFannuali.Year,1,1), DATIECMWFannuali.SMB_priestleymm,'m-*', 'DisplayName','MAR');
hold off
legend('Location','best')
% figure
If that does not solve the problem, please explain in more detail what you want plotted in specific figures.
.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Graphics Performance 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!