Same colormap with colorbar which has two axes

조회 수: 11 (최근 30일)
Jack M
Jack M 2019년 8월 2일
편집: Jack M 2021년 6월 12일
Hi,
Would it be possible to have a colorbar with two variables (one on each side of the colorbar)?
I.e. if you take this Colorbar for example, I would like to also have different values on the left side of the colorbar for a different variable which shares the same units.
Thank you.

답변 (2개)

John Doe
John Doe 2019년 8월 2일
  댓글 수: 1
Jack M
Jack M 2019년 8월 3일
Unfortunately, that is not what I was looking for.
I wanted one colormap with a colorbar with two axes (two variables) where I get to pick the ticks for each of the variables on either side of the colorbar.
Hope that clarifies things?

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


Rik
Rik 2019년 8월 13일
You can add a second tick row on the right side of the colorbar using the code below.
f=figure;
image
c_handle=colorbar;
%c_handle=findobj(get(f,'Children'),'Tag','Colorbar');
new_ax=axes(...
'Parent',f,...
'Units',c_handle.Units,'Position',c_handle.Position,...
'Color','none',...
'YTick',1:10,'YLim',[1 10],...
'XTick',[],...
'TickDir','out');

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by