Same colormap with colorbar which has two axes
5 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
回答(2 个)
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');
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Red 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!