Colormap not showing properly
Show older comments
I used both cmocean and colormap for plots, and when I dont define the levels of the color (i.e. the quantity of colors) it displays normally. But when I put the quantity such as:
colormap(jet(15))
cmocean('tarn',15) (this is in the climate data toolbox
The higher colors are distorted as I show you here (the distorted vs the normal colormap)
Whats the reason? I checked both 2023a and 2022b versions and the problem is still here.


Accepted Answer
More Answers (1)
Ishit
on 15 Jun 2023
0 votes
Hi Luis,
The reason for the distortion in the higher colors of your colormap when you define the number of levels is likely due to the way that the colors are mapped to the data values. When you specify the number of levels (i.e., the number of colors) in your colormap, MATLAB or the Climate Data Toolbox (CDT) uses that number to determine how to map the colors to the data values.
It's also possible that there may be differences in the way that colormap and cmocean handle the mapping of colors to data values. You may want to try using different colormaps or adjusting the parameters of the colormap functions to see if that resolves the issue.
1 Comment
Luis Jesús Olvera Lazcano
on 15 Jun 2023
Categories
Find more on Color and Styling 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!


