How can I create a correct lambertian colormap from my data with map_m package?

4 vues (au cours des 30 derniers jours)
Hi All,
I tried create a lambertian map using with map_m package by the following way:
lon=[-40.375:0.25:75.375];lat=[25.375:0.25:75.375];
lon2(:,1)=lon(1,:); #lon2(464,1)
lat2(:,1)=lat(1,:); #lat2(201,1)
clim5=reshape(clim3,[464,201]); # where clim3(93264,1)
m_proj('lambert','lon',[-40.375 75.375],'lat',[25.375 75.375]);
m_coast('patch',[1 .85 .7]);
hold on
m_pcolor(lat2,lon2,clim5);
but I got the following map (attached). I do not know what I did wrong. Could someone write me how I can create a correct lambertian colormap from my data? Thank you for your help in advance!

Réponse acceptée

Kelly Kearney
Kelly Kearney le 15 Sep 2015
"lambertian" is a fun new word... :-)
What you're seeing is just the block outline of all the grid cells; by default, all Matlab pcolor plots (including those generated by m_pcolor) use this style. You can remove the outlines via:
set(findobj('tag', 'm_pcolor'), 'edgecolor', 'none');
(In non-m_map plots, you could use the shading flat shortcut, but I find that doesn't always play nicely with m_map objects).
  2 commentaires
Szabó-Takács Beáta
Szabó-Takács Beáta le 16 Sep 2015
Sorry for my mistake concerning lambertian :-) I thought Lambert Conformal Conic projection. I tried your suggestion. The resulted figure is better (attached) but I don not know how can I interpolate my data to the full area? I tried griddata interpolation:
x=-40.375:0.25:75.375;y=25.375:0.25:75.375;[x,y]=meshgrid(x,y);
>> vq=griddata(lon2,lat2,clim5,x,y,'nearest');
but I got:
Error using griddata (line 112)
The lengths of X and Y must match the size of Z.
Could you offer me a solution?
Szabó-Takács Beáta
Szabó-Takács Beáta le 16 Sep 2015
Finaly I could solve my mistake. I draw the values with
m_pcolor(lon,lat,clim5)
where lon is the x axis lat is the y axis as in the Lambert Conformal Conic projected map.

Connectez-vous pour commenter.

Plus de réponses (0)

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by