Threshold contour without changing colormap
2 views (last 30 days)
Show older comments
How can I create a threshold contour without changing an existing colormap? Here is my code:
figure(1)
hold on
m_contourf(lon,lat,(ndustaCNT)',40,'LineStyle','none');
m_contourf(lon,lat,(ndustaCNT)',[0 0],'Color','w');
m_coast('line','Color','k');
m_grid('xtick',10,'tickdir','out','yaxislocation','left','fontsize',10);
c3 = colorbar('WestOutside');
I want to keep the colormap associated with the ndustaCNT matrix but overlay a single white contour where values equal zero. When I add in the second m_contourf line, the colormap changes and I lose all the structure. Thanks for your help. - Sylvia
0 Comments
Answers (1)
Chad Greene
on 1 Nov 2015
figure(1)
hold on
m_contourf(lon,lat,(ndustaCNT)',40,'LineStyle','none');
freezeColors;
m_contourf(lon,lat,(ndustaCNT)',[0 0],'Color','w');
m_coast('line','Color','k');
m_grid('xtick',10,'tickdir','out','yaxislocation','left','fontsize',10);
c3 = colorbar('WestOutside');
See Also
Categories
Find more on Colormaps in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!