Changing the number format of colorbar values

40 ビュー (過去 30 日間)
John
John 2016 年 2 月 18 日
コメント済み: John 2016 年 2 月 19 日
My color bar values are huge and I would love to maximize on the plot space. How can I change the values of my colorbar to say value * 10^8. Thanks
  2 件のコメント
Walter Roberson
Walter Roberson 2016 年 2 月 19 日
Which MATLAB version? The methods are different from R2014b onwards.
John
John 2016 年 2 月 19 日
R2015b

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

採用された回答

Walter Roberson
Walter Roberson 2016 年 2 月 19 日
In R2014b or later, colorbar objects have a http://www.mathworks.com/help/matlab/ref/colorbar-properties.html TickLabels property and also a TickLabelInterpreter. So you could for example,
cb = colorbar();
set(cb, 'Ticks', [10^7, 2.5*10^7, 5*10^7, 7.5*10^7, 10^8], 'TickLabels', {'10^7', '2.5 x 10^7', '5 x 10^7', '7.5 x 10^7', '10^8'}, 'Interpreter', 'tex')
  1 件のコメント
John
John 2016 年 2 月 19 日
Works perfect. Thanks.

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

その他の回答 (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