How to display a color bar in Matlab as shown below
    8 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
 
                     
          Hello, experts.
I want to draw a color bar with discontinuous and regular intervals like the first picture above.
However, it would be best to draw a continuous color bar like the second picture. Is there a solution?
0 comentarios
Respuestas (3)
  Aquatris
      
 el 6 de Ag. de 2024
        You can call the colorbar function with the desired tick values
Z = peaks;
contourf(Z)
colorbar('ticks',[-6:0.5:8])
0 comentarios
  Kunal Kandhari
      
 el 6 de Ag. de 2024
        you can use the 'colorbar' function. This allows you to represent both types of intervals effectively.
colorbar('ticks',[0.3:0.05:0.5])
read more about it here: 
0 comentarios
  Angelo Yeo
    
 el 6 de Ag. de 2024
        Small size of colormap leads to discrete-looking colorbar.
surf(peaks)
cmap = jet(10);
colormap(cmap)
colorbar;
0 comentarios
Ver también
Categorías
				Más información sobre Blue en Help Center y File Exchange.
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!





