colorbar position on imageplot with multiple figures

조회 수: 1 (최근 30일)
Shane
Shane 2013년 4월 17일
I have an image plot with two figure on it. When I add the color bar, with whatever location parameters I used, it uses those location parameters relative to the last image in the image plot.
Can I make the colorbar more global, i.e., below both images in my imageplot?

답변 (1개)

Adam Filion
Adam Filion 2013년 4월 17일
편집: Adam Filion 2013년 4월 17일
Colorbars are associated with a particular axis. If you do not specify which axis, then it will be added to the last one you used. See the documentation on colorbar for info on how to use a handle to the axis to specify which axis to add it to using the peer property of the colorbar:
>> doc colorbar
I don't know of an easy way to place a colorbar in an arbitrary location, such as spanning the width of a figure with two subplots above it. The best solution I know of offhand is to use the GUI Layout Toolbox from the File Exchange to construct this:
It's a very powerful set of tools with great documentation to go with it. If anyone has a simpler solution (another FEX submission maybe?) I'd love to hear it.

카테고리

Help CenterFile Exchange에서 Colorbar에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by