Hist3 zero enteries

5 views (last 30 days)
Ankita Gupta
Ankita Gupta on 19 Nov 2022
Commented: Steven Lord on 20 Nov 2022
I have the following code which gives me
bin_x = linspace(0,1,100);
bin_y = linspace(0,1,100);
X=[x1 x2];
[x,y] = meshgrid(bin_x,bin_y);
which gives me
when I view this using axis([0 1 0 1]) in 2D plane it gives me
I want the change the color of blue area in surf plot to some lighter color and in 2D plot, I want to remove the blue colored area, how do I do that.

Answers (1)

Steven Lord
Steven Lord on 19 Nov 2022
Instead of using hist3 I recommend you use histogram2 instead. It has some properties, including Normalization and ShowEmptyBins, that you may find useful.
Steven Lord
Steven Lord on 20 Nov 2022
hist3 and histogram2 are not called with exactly the same input arguments. You will need to modify your code to replace calls to hist3 with calls to histogram2 and then modify the input argument list in your histogram2 call. See the histogram2 documentation page for the allowed calling sequences and examples of how to call it.

Sign in to comment.


Community Treasure Hunt

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

Start Hunting!