changing from contour to filled on pcolor plot

3 views (last 30 days)
Giulia
Giulia on 4 May 2023
Answered: Piyush on 18 May 2023
Hello :)
How can I add contours (at 0.05, 0.075, 0.1 degrees) instead of filled colours in this pcolor plot?
Thank you in advance!
Code I used for the figure is below
cm1 = brewermap(40,'RdPu');
cm1(cm1>1) = 1;
cm1(cm1<0) = 0;
LONLIMS=[-16 7.8];
LATLIMS=[47 62];
figure
m_proj('miller','lon',LONLIMS,'lat',LATLIMS);
m_pcolor(lont(1:end-1),latt(1:end-1),mean(tdh,3)')
shading flat
caxis([0.05 0.1])
colormap(cm1)
m_grid('fontsize',10);
m_gshhs_f ('patch',[.8 .8 .8],'edgecolor',[.1 .1 .1]);
cb = colorbar;
cb.Label.String = 'Horizontal Temperature gradient (\circC)';

Answers (1)

Piyush
Piyush on 18 May 2023
Refer to the answer given in the following question.
It states how to overlay contour and pcolor.

Categories

Find more on Contour Plots in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!