A question about adjustment the Histogram2 Properties
9 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello all, Do you know how to:
A: Delete the black line around each square of left side figure ( to be similar to the right side figure)
B: change the square size of left side figure to the size of the right side figure?
Here is my script to generate both of these figures, for two different datasets:
Rights side figure:
h = histogram2(X,Y,'DisplayStyle','tile','ShowEmptyBins','off');
colormap turbo(40)
caxis([10,90])
xlim([0 500])
ylim([0 500])
Left side figure:
h = histogram2(X,Y,'DisplayStyle','tile','ShowEmptyBins','off');
colormap turbo(40)
caxis([10,90])
xlim([0 1000])
ylim([0 1000])
0 Kommentare
Akzeptierte Antwort
Dave B
am 8 Dez. 2021
Bearbeitet: Dave B
am 8 Dez. 2021
For the first bit, you can set the EdgeColor to 'none'.
For the second bit, getting 'squares' depends on both the fact that bins that you've used for the histogram and the aspect ratio of your axes. If you use equal sized bins and axis equal, you should be in good shape. To adjust the size of the bins, just specify the values for the bin edges:
x=randn(10000,1);
y=x+randn(10000,1);
xbins=linspace(-5,5,30);
ybins=linspace(-5,5,30);
histogram2(x,y,xbins,ybins,'DisplayStyle','tile','EdgeColor','none')
grid off
axis equal
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Histograms finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!