Awefully simple code in order to gain some time when trying to label the colorbars.
Works for individual plot or subplots, handles single- and multi-line labels on the top, bottom and/or right of the colorbar.
Input: colorbar handle ([] if unknown), label location ('top', 'bottom' or 'right'), indication for subplots (1 if subplots, 0 otherwise), text label (normal MatLab style)
Output: Nicely postioned labels for the colorbars
Warning: 1) If the label is too close to the colorbar or graph, try reapplying the function, it will largen up the gap
Example: colorbarlabel([],'r',0,[{'String line1'},{'String line2'}])
Citar como
Fanny Besem (2024). Colorbar labeling (https://www.mathworks.com/matlabcentral/fileexchange/32437-colorbar-labeling), MATLAB Central File Exchange. Recuperado .
Compatibilidad con la versión de MATLAB
Compatibilidad con las plataformas
Windows macOS LinuxCategorías
- MATLAB > Graphics > Formatting and Annotation > Colormaps >
- MATLAB > Graphics > Formatting and Annotation > Labels and Annotations > Title >
- MATLAB > Graphics > Formatting and Annotation > Labels and Annotations > Colorbar >
Etiquetas
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Descubra Live Editor
Cree scripts con código, salida y texto formateado en un documento ejecutable.
Versión | Publicado | Notas de la versión | |
---|---|---|---|
1.0.0.0 |