MATLAB Answers

sam ira

Logarithmic color scale in 2d histogram

Asked by sam ira
on 8 Oct 2018
Latest activity Commented on by ANKUR KUMAR on 8 Oct 2018
I am looking for a way to change the colorbar of a 2d histogram plotted with DisplayStyle = 'tile' to a logarithmic scale so that one can better distinguish the frequencies. Unfortunally histogram2 has no property 'ColorScale'. Thanks in advance!


Sign in to comment.

1 Answer

Answer by ANKUR KUMAR on 8 Oct 2018

Use ruler.scale to set log axis in colorbar.
cx= colorbar();
cx.Ruler.Scale = 'log';
cx.Ruler.MinorTick = 'on';


I already tried this but got a
Warning: Error updating ColorBar
DataSpace or ColorSpace transform method failed
Please attach you code along with the .mat file containing required variables.

Sign in to comment.