フィルターのクリア

Is it possible to make contour graph with log scale colorbar?

21 ビュー (過去 30 日間)
Marin
Marin 2012 年 8 月 9 日
So, basicaly it's all explained in the title. I would like to make contourf plot but in such a way that the colorbar is in log scale because I have quite a large range of values in my data.
I've read all the help on contour and contourf functions and colorbar but nothing useful can be found there.
Thank You in advance!

採用された回答

Wayne King
Wayne King 2012 年 8 月 12 日
編集済み: Wayne King 2012 年 8 月 12 日
Sure just take the log() of the input matrix Z. I'm assuming your data are nonnegative.
z = peaks;
z = abs(z);
contourf(log(z))
colorbar
Or if you want it in "dB"
contourf(10*log10(z))
  1 件のコメント
Marin
Marin 2012 年 8 月 14 日
Yeah this works fine, thank You :)
By the way, is there a way to manualy write labels on colorbar? What I mean is, when I plot
contourf(log10(z))
my colorbar has values 0, 1, 2, 3, ... is there any way I can get it to write 10^0, 10^1, 10^2, 10^3, ... ?

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by