一個(gè)matlab colorbar的簡易代碼cmocean
matlab自帶的色階不全,無法滿足繪圖的需求,而cmocean函數(shù)提供了一些常用的色階。
函數(shù)命令:cmocean(ColormapName,varargin),其中的ColormapName有如下的可選參數(shù):

各個(gè)參數(shù)的繪圖效果如下:

另外的一個(gè)參數(shù),'pivot',指的是作為中間色的數(shù)值,比如我們經(jīng)常使用的兩色bar,中間的白色為0,其余的兩側(cè)為正負(fù)的數(shù)值。'pivot'就是改變這個(gè)白色對應(yīng)的數(shù)值,比如設(shè)置為5.下圖是具體的顯示效果:

?歡迎大家點(diǎn)贊收藏!
百度網(wǎng)盤:
鏈接:https://pan.baidu.com/s/1zBWzLvfnLdOezxzMR-V9Cg?pwd=ucas?
提取碼:ucas
參考文獻(xiàn):
?Thyng, K.M., C.A. Greene, R.D. Hetland, H.M. Zimmerle, and S.F. DiMarco. 2016. True?
colors of oceanography: Guidelines for effective and accurate colormap selection.?
Oceanography 29(3):9?13, http://dx.doi.org/10.5670/oceanog.2016.66.
標(biāo)簽: