Stipple hatch on a Arctic map isn't showed correctly
6 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Anna
le 17 Fév 2024
Commenté : Austin M. Weber
le 21 Fév 2024
Hello! I'm using m_map toolbox and stipple function from Climate Data Toolbox to create an Arctic map with spatial correlation. I ran into problem that stipple hatch looks more like a line than a stipple closer to a pole. How can that be solved? Image is attached. My code looks like this:
[latp,lonp] = meshgrid(lat,new_lon);
figure
m_proj('stereographic','lat',90,'long',-360,'radius',23)
hold on
[CS,CH]=m_contourf(new_lon,lat,corr_sc_sh_w',[-1:.04:1],'edgecolor','none');
axb=m_contfbar([.3 .7],-.025,CS,CH,'endpiece','no');
axb.FontSize = 12;
axb.XLabel.String = 'correlation coef';
m_coast('line','color','#414141','linewi',1)
m_grid('xtick',12,'tickdir','out','ytick',[70 75 80 85 90],'yticklabels',[],'linest','--','color','#414141');
colormap(cmocean('balance','pivot',0))
hold on
[x,y]=m_ll2xy(lonp,latp);
stipple(x,y,mask,'density',1000,'markersize',3)
title('DJFM SiConc-SH','fontsize',16,'Position',[0, 0.43, 0]);
0 commentaires
Réponse acceptée
Austin M. Weber
le 20 Fév 2024
Since your chart is shown using a stereographic projection, the stipple marks closest to the pole only appear like a line. This is because the distance between longitudinal coordinates decreases as you move poleward, and so the stipples are essentially being plotted on top of one another.
One potential way to resolve this would be to decrease the 'density' name-value pair and/or the marker size for your chart:
stipple(x, y, mask, 'density', 500, 'markersize', 2)
Alternatively, if you don't want to apply those changes to the entire figure, you can try making an index for all the stipple marks above 70 degrees N latitude and then plot those values separately from the stipple marks at lower latitudes, but with a different density and marker size.
stipple(x_below70, y_below70, mask_below70, 'density', 1000, 'markersize',3)
stipple(x_above70, y_above70, mask_above70, 'density', 500, 'markersize',2)
If neither of these options work, consider attaching a .mat file containing your data (or a fake dataset with a similar issue) and then either myself or another one of the volunteers can try to figure things out on your behalf.
Plus de réponses (1)
Anna
le 21 Fév 2024
1 commentaire
Austin M. Weber
le 21 Fév 2024
@Anna, I'm glad you have found a solution! Packaging everything into a function is a good idea.
Voir également
Catégories
En savoir plus sur Glaciology dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!