Why is my histogram only displaying 3 bins? And why is the xlabel not printing?

3 views (last 30 days)
histo_1 = histogram(histovalues,'BinWidth',0.01);
xlabel('$Q_\mathrm{ice} \mathrm{Nm}$')
% inserting normal distribution fit onto the histogram:
rng default; % For reproducibility
norm_fit = normrnd(1,10,100,1);%random arrays from normal distribution, normrnd(mean, sd, rows of norm_fit, norm_fit cols)

Answers (1)

Walter Roberson
Walter Roberson on 11 Aug 2022
You ask for BinWidth 0.01 . Perhaps your data spans less than 0.03 so only 3 bins are justified.
xlabel('$Q_\mathrm{ice} \mathrm{Nm}$')
You should probably
xlabel('$Q_\mathrm{ice} \mathrm{Nm}$', 'interpreter', 'latex')

Community Treasure Hunt

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

Start Hunting!

Translated by