How can I set the collorbar to logarithmic scale using histogram2?

26 ビュー (過去 30 日間)
Robert Grandl
Robert Grandl 2017 年 4 月 15 日
回答済み: Ankitha Kollegal Arjun 2017 年 4 月 19 日
Hello everyone, I have a realy bothersome problem. I have a 2d data which should be evaluated at a histogram and I want to change the zScale to logarithmic. Using histogram2 it is a realy easy task. (histogram and logarithmic zScale) But the colorbar coloring the z direction stays at linear scale. Everything I tried did not work. Every solution I found online seemd to work only with older matlab versions (my version is r2015).
I hope someone can help me.
Best regards RobertG

回答 (1 件)

Ankitha Kollegal Arjun
Ankitha Kollegal Arjun 2017 年 4 月 19 日
You could try the following:
histogram2(randn(1000,1),randn(1000,1));
set(gca,'zscale','log');

カテゴリ

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

製品

Community Treasure Hunt

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

Start Hunting!

Translated by