How to flip x & y axes of a colorbar
Ältere Kommentare anzeigen
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.
Antworten (1)
John Trimper
am 30 Okt. 2014
Bearbeitet: John Trimper
am 30 Okt. 2014
Kategorien
Mehr zu Color and Styling finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!