Skip to content

colorbar

Add a color-scale legend to the figure.

h = colorbar
h = colorbar(side, ...)

Adds a vertical colorbar showing the mapping from data values to colors. Optional side is a string: 'east' (right, default), 'west', 'north', 'south'. Trailing name-value pairs control colorbar properties.

surf(peaks(50)); colorbar
colorbar('south')
  • legend — Add a legend to the chart.