How to make one colorbar for all subplots?

조회 수: 186 (최근 30일)
Ronny
Ronny 2014년 8월 2일
댓글: 冠中 王 2022년 4월 6일
Hi everybody
So I made a plot with four subplots (2x2). Now I would like to insert one (big) colorbar on the right Hand side of the four plots without changing the size of any of the plots. Somehow I only manage to make a bar for one subplot...
Cheers Ronny

채택된 답변

Star Strider
Star Strider 2014년 8월 2일
I assume you’ve already discovered the colorbar function. See Axis Properties for a description of the properties you can set. The location property applies only to colorbars and legends, not to axes.
  댓글 수: 4
Shan  Chu
Shan Chu 2020년 2월 13일
Please help.
Thanks
冠中 王
冠中 王 2022년 4월 6일
For matlab 2019b or after, Create tiled chart layout - MATLAB tiledlayout (mathworks.com) also works and it is easier.

댓글을 달려면 로그인하십시오.

추가 답변 (2개)

Ronny
Ronny 2014년 8월 3일
Thanks that works
  댓글 수: 1
Star Strider
Star Strider 2014년 8월 3일
My pleasure!
You can adjust its left edge position by increasing or decreasing the 0.01 in the first element of the 'Position' vector, and its width by adjusting the third element of the vector.

댓글을 달려면 로그인하십시오.


Emmanouil Barmpounakis
Emmanouil Barmpounakis 2017년 4월 25일
I came up with the Star Strider's solution but by using the Edit plot function. I found it easier to do it manually, rather than changing the 'Position' vector.tor.

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by