There are three three files
Recolor_pcolor.m , Recolor_contourf.m and colorbar_levels.m
The Recolor_pcolor/Recolor_contourf functions re-assign the specific colors to specific levels. The required colormap must be assigned to the pcolor/contourf plots before calling this function. The number of colors in the colormap must be one plus the length of levels.
While making the contourf plot make it on [min(data) Levels] levels. In addition to that keep max(Levels) <max(data)
After plotting pcolor set the caxis on bounds [min(data) max(Levels)]
All comments are welcome.
Thanks
Mak
引用格式
Makarand (2024). Use of discrete colors in contourf and pcolor with colorbar (https://www.mathworks.com/matlabcentral/fileexchange/28073-use-of-discrete-colors-in-contourf-and-pcolor-with-colorbar), MATLAB Central File Exchange. 检索时间: .
MATLAB 版本兼容性
平台兼容性
Windows macOS Linux类别
标签
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!