フィルターのクリア

How to put a name / unit in ColorBar

17 ビュー (過去 30 日間)
Haimon
Haimon 2013 年 8 月 14 日
I created an image through some variables obtained.
I wanted to put a ColorBar with the name of the variable and also the unit.
I have accomplished the easiest task, to put a colorbar in the graph.
Can someone help me with how to put the name/units of the colorbar?
This part of the code looks like this:
image(rho); colorbar('location','SouthOutside'); colormap(hsv(10));
Sorry if this question is too simple. I'm just a beginner student in MatLab and programming.

採用された回答

Walter Roberson
Walter Roberson 2013 年 8 月 14 日
cbh = colorbar('location', 'SouthOutside');
set(cbh, 'Units', 'normal');
text(0, 9/10, 'hello', 'Parent', cbh)
  1 件のコメント
Image Analyst
Image Analyst 2013 年 8 月 14 日
I don't have MATLAB on this computer, but if I remember correctly, isn't there a demo in the help for colorbar(), or maybe colormap(), that shows how to change out the words beside the tick marks of a colorbar to something you specify?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeColormaps についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by