Colorbar with a range taken from a variable
Mostra commenti meno recenti
Hello,
I have a matrix organized in this way:
M= col1, col2.... col10
col1 and col2 are the x and y position of the data, col10 is a property of this data and it is a number.
I would like to use the numbers in col10 to make a colormap and assign ot every point a specific color that depends on the value in col10.
I did this long time ago, but I don't remember how, can somebody help me, please?
Thanks
F.
Risposta accettata
Più risposte (1)
Rahul Chowdhury
il 5 Ago 2024
Try something like
M = [col1; col2; col10];
contourf(M, col10)
colorbar('Ticks', col10)
This creates a contour plot with the specific levels from col10 and while labeling them in a color bar. Let me know if this helps.
Categorie
Scopri di più su Graphics Objects in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


