Try this:
D1 = load('X.mat');
D2 = load('Y.mat');
X = D1.X;
Y = D2.Y;
data = [X,Y];
hh3 = hist3(data, 'Nbins',[1 1]*60);
figure
image(flipud(hh3))
ax = gca;
xt = ax.XTick;
yt = ax.YTick;
ax.XTickLabel = xt*10;
set(ax, 'YTick',[0 yt], 'YTickLabel', [flip([0 yt])]*10)
producing:
Experiment to get different results.
. Answer from Star Strider on mathworks.com
MathWorks
mathworks.com › matlab › graphics › 2-d and 3-d plots › data distribution plots
Histogram2 - Bivariate histogram plot - MATLAB
Data to distribute among bins, specified as separate arguments of vectors, matrices, or multidimensional arrays. X and Y must be the same size. histogram2 treats matrix or multidimensional array data as single column vectors, X(:) and Y(:), and plots a single histogram.
MathWorks
mathworks.com › matlab › graphics › 2-d and 3-d plots › data distribution plots
Histogram2 - Bivariate histogram appearance and behavior - MATLAB
Histogram2 properties control the appearance and behavior of the histogram.
MathWorks
mathworks.com › matlab › graphics › 2-d and 3-d plots › data distribution plots
histcounts2 - Bivariate histogram bin counts - MATLAB
For more information, see Run MATLAB Functions in Thread-Based Environment. ... You can normalize histogram values as percentages by specifying the Normalization name-value argument as 'percentage'. histogram | histcounts | discretize | histogram2 | morebins | fewerbins
MathWorks
mathworks.com › statistics and machine learning toolbox › descriptive statistics and visualization › managing data
hist3 - (Not recommended) Bivariate histogram plot - MATLAB
You can use the name-value pair arguments of histogram2 to use normalization (Normalization), adjust the width of the bins in each dimension (BinWidth), and display the histogram as a rectangular array of tiles instead of 3-D bars (DisplayStyle). ... Run the command by entering it in the MATLAB ...
Cdslab
cdslab.org › paramonte › notes › examples › matlab › mlx › visualization_histogram2.html
Making 2D histogram plots with the ParaMonte visualization tools
To draw the 2D histogram, the ParaMonte visualizer utilizes the histogram2() function of MATLAB. One can pass pairs of (key,value) properties to this MATLAB function by defining those keyword properties in the histogram2 component of the plot object.
MathWorks
mathworks.com › matlabcentral › answers › 461874-change-colormap-of-histogram2
change colormap of histogram2 - MATLAB Answers - MATLAB Central
May 13, 2019 - Hi, I was looking for a way to change the colormap for histogram2 from parula to something else. Couldn't find it. x = randn(5000); y = randn(5000); h = histogram2(test1, test2, 'DisplayStyle',...
MathWorks
mathworks.com › matlabcentral › answers › 557791-extract-data-using-histogram2
Extract data using histogram2() - MATLAB Answers - MATLAB Central
July 1, 2020 - If you want the data that was passed into histogram2 retrieve the Data property of the histogram.
MathWorks
mathworks.com › matlabcentral › answers › 471261-how-to-construct-a-weighed-2d-histogram
How to construct a weighed 2D histogram? - MATLAB Answers - MATLAB Central
July 11, 2019 - H = histogram2( X, Y ) to plot (along the z-axis) the sum/count of number of points per bin. My question: how can I modify this to account for the weight of every sample point within a bin?
MathWorks
mathworks.com › matlabcentral › answers › 837553-histogram-of-a-a-function-with-two-variable
histogram of a a function with two variable - MATLAB Answers - MATLAB Central
May 23, 2021 - H = HISTOGRAM2(...) also returns a Histogram2 object. Use this to inspect and adjust the properties of the histogram. Class support for inputs X, Y, XEDGES, YEDGES: float: double, single integers: uint8, int8, uint16, int16, uint32, int32, uint64, int64 logical See also HISTCOUNTS2, HISTCOUNTS, HISTOGRAM, DISCRETIZE, matlab.graphics.chart.primitive.Histogram2 Documentation for histogram2 doc histogram2 Other functions named histogram2 tall/histogram2
Plotly
plotly.com › matlab › 3D-histogram
3d histograms in MATLAB
Generate 10,000 pairs of random numbers and create a bivariate histogram. The histogram2 function automatically chooses an appropriate number of bins to cover the range of values in x and y and show the shape of the underlying distribution.
MathWorks
mathworks.com › matlab › graphics › 2-d and 3-d plots › data distribution plots
histcounts - Histogram bin counts - MATLAB
histogram | histogram2 | discretize | histcounts2 | kde · Replace Discouraged Instances of hist and histc · You clicked a link that corresponds to this MATLAB command: Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
MathWorks
mathworks.com › matlabcentral › answers › 2102616-how-to-draw-an-histogram
How to draw an histogram? - MATLAB Answers - MATLAB Central
April 3, 2024 - It sounds like you want the second ... or a matrix (use histogram2). Here is an example of both. ... This is the right question: How do I draw an histogram knowing the frequency of all the individual elements in a 150x150 matrix appears using matlab?...
MathWorks
mathworks.com › matlabcentral › answers › 403222-how-to-normalize-a-histogram2-along-one-dimension
How to normalize a histogram2 along one dimension? - MATLAB Answers - MATLAB Central
May 30, 2018 - Histogram2 provides an alternative, where bin heights or colors show the amount of counts or probability (or corresponding density) to have events in a given region.
MathWorks
mathworks.com › matlabcentral › answers › 1950748-apply-different-colormaps-to-different-data-sets-on-histogram2
Apply different colormaps to different data sets on histogram2 - MATLAB Answers - MATLAB Central
April 21, 2023 - histogram2(x, y, xedges, yedges, 'normalization', 'probability', 'DisplayStyle','tile', 'FaceColor','flat') hold on histogram2(x2, y2, xedges, yedges, 'normalization', 'probability',...