Issue with contourfm from Matlab 2024b
6 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hello,
I have to plot some data over these coordinates:

Until Matlab 2024a release I was able to correctly do it with contourfm through the code line:
contourfm(latPlot,lonPlot,data,CXanom(lp,1):0.125:CXanom(lp,2),'LineStyle','none');
From Matlab 2024b release, lat and lon are not accepted anymore and there is the need to create reference raster cells. Here the code for Matlab 2024b:
ax=worldmap([min(latPlot(:)),max(latPlot(:))],[min(lonPlot(:)),max(lonPlot(:))]);
RefCells=georefcells([min(latPlot(:)),max(latPlot(:))],[min(lonPlot(:)),max(lonPlot(:))],[size(latPlot)]);
contourfm(data,RefCells,CXanom(lp,1):0.125:CXanom(lp,2),'LineStyle','none');
hold on;
[C,h]=contourm(data,RefCells,CXanom(lp,1):StepLineAnom:CXanom(lp,2),'k');
if isempty(C)
continue;
else
clm=clabelm(C,h,CXanom(lp,1):StepLineAnom:CXanom(lp,2));
for kk=1:numel(clm)
clm(kk).BackgroundColor='none';
clm(kk).FontWeight='bold';
clm(kk).Color='k';
end
for kk=1:numel(h.Children)
h.Children(kk).LineStyle=':';
end
end
plotm(BordersWorldHR(:,2),BordersWorldHR(:,1),'k');
p=plotm(LatCC,LonCC,'xw');
p.MarkerSize=8;
p.LineWidth=2;
p.MarkerEdgeColor=[0.96,0.96,0.96];
p.MarkerFaceColor=[0.96,0.96,0.96];
setm(ax,'FontSize',10);
colormap(turbo);
hc=colorbar;
ylabel(hc,['TB Anomaly ',AMSUA_ch{ch},' GHz (K)']);
hc.FontSize=9;
hc.Ticks=CXanom(lp,1):(CXanom(lp,2)-CXanom(lp,1))/size(CMP1.(FN1),1):CXanom(lp,2);
hc.TickLabels=num2str(hc.Ticks','%.1f');
clim(CXanom(lp,:));
hl=legend(p,'Min MSLP');
hl.Location='NorthWest';
hl.FontSize=8;
hl.Color=[0.82,0.82,0.82];
set(gcf,'InvertHardCopy','off');
What I get is the following:

but what I have to get is the following (made with pcolorm):

Can anyone help me to fix this issue? I attach both the data and the figures. Thanks.
0 Commenti
Risposte (0)
Vedere anche
Categorie
Scopri di più su Weather and Atmospheric Science in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!