CLIMBND Adjusts clim values so that bounding colors are restricted to those values that lie outside of the cmin and cmax limits.
Usage:
climbnd([cmin, cmax])
climbnd(hA, [cmin, cmax])
hA: axis handle
cmin, cmax: minimum and maximum limits for color plot
Background:
climbnd provides a way account for values that lie out of the climit range. The Matlab documentation for the clim function states:
"All values in the colormap indexing array that are less than or equal to cmin map to the first row in the colormap. All values that are greater than or equal to cmax map to the last row in the colormap.
All values between cmin and cmax map linearly to the intermediate rows of the colormap."
This definition means that that the first and last colors are used for values outside the climit range and also as part of the color ramp for values that lie inside the climit range.
As a result, the bounding colors do not align correctly with the cmin and cmax limits. The climbnd function allows for the first and last colors in the color map to represent values that are outside the climit range.
Motivation:
I came across this problem when trying to create a pcolor plot of cloud water in a cross section of the atmosphere. I wanted regions with negative values of cloud water density to plot with a blue color (cmin = 0), and the positive values to plot with a color ramp going from light to dark gray for the range cmin to cmax. The Matlab clim function allowed the bounding blue color to extend into the positive range for the cloud water density.
Mark Brandon, Yale University, 2020-2022
引用格式
Mark Brandon (2024). climbnd (https://www.mathworks.com/matlabcentral/fileexchange/117255-climbnd), MATLAB Central File Exchange. 检索时间: .
MATLAB 版本兼容性
创建方式
R2022a
兼容任何版本
平台兼容性
Windows macOS Linux标签
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!