How to flip x & y axes of a colorbar
Mostrar comentarios más antiguos
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.
Respuestas (1)
John Trimper
el 30 de Oct. de 2014
Editada: John Trimper
el 30 de Oct. de 2014
Categorías
Más información sobre Color and Styling en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!