How to flip x & y axes of a colorbar
Afficher commentaires plus anciens
I want to put a colorbar in a figure and have the colorbar horizontally span the length of 3 subplots underneath them. How can I do this and have the colorbar values scale horizontally instead of vertically?
myfig=figure;
subplot(1,3,1);
sp1=plot(1,1,'o', 'markersize', 40, 'markerfacecolor', 'b');
set(gca, 'visible', 'off');
subplot(1,3,2);
sp2=plot(1,1,'o', 'markersize', 40, 'markerfacecolor', 'g');
set(gca, 'visible', 'off')
subplot(1,3,3);
sp3=plot(1,1,'o', 'markersize', 40, 'markerfacecolor', 'r');
set(gca, 'visible', 'off')
colbar=colorbar('Position', [.25 .1 .5 .05]);
colormap jet
I know I could set the colorbar to be 'south' of subplot 2, but then it won't be as wide as I want.
Réponses (1)
John Trimper
le 30 Oct 2014
Modifié(e) : John Trimper
le 30 Oct 2014
Catégories
En savoir plus sur Color and Styling dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!