Colorbar colors wont scale to changed scale limits
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Zachary Ferrie
am 28 Jun. 2019
Kommentiert: Zachary Ferrie
am 28 Jun. 2019
Hi all,
I have the following code.
cb = colorbar();
set(cb, 'ylim', [0.1 10])
cb.Ticks = [0.1 1 10];
cb.Ruler.Scale = 'log';
cb.Ruler.MinorTick = 'on';
.
.
.
scatter(particle1_newlng,particle1_newlat, 10, V_curr, 'filled');
I am trying to change the color of the x and y coordinates based on the velocity input (V_curr). This scale is a log scale from 0.1 to 10 for the colorbar.
However when I run the above code the colors do not fade evenly over the entire scale (see picture). Any ideas on how to fix this??
![untitled.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/226788/untitled.png)
0 Kommentare
Akzeptierte Antwort
Adam
am 28 Jun. 2019
You should be using
doc caxis
to change colourmap limits, not directly going into the colourbar object and changing its ylims. This will literally just change the ylims of the colourbar and will have no effect on the underlying colourmap itself.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Red finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!