histogram without Y axis
8 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello all,
I would like to plot a histogram and show the values of the Y axis on the bars instead of the Y axis. It means I would like to know eliminate the Y axis.
Is there any way?
0 Kommentare
Antworten (2)
Image Analyst
am 29 Okt. 2012
Try this demo:
close all;
clc;
y = rand(1,1000);
[counts values] = hist(y);
bar(values, counts, 'BarWidth', 0.95);
% Enlarge figure to full screen.
set(gcf, 'units','normalized','outerposition',[0 0 1 1]);
hold on;
for bin = 1 : length(counts);
x = values(bin);
barTop = counts(bin) + 2;
header = sprintf('%d', counts(bin));
text(x, barTop, header);
end
grid on;
% Make sure you call this AFTER text, not before,
% otherwise it will shrink the plot.
set(gca,'ytick',[])
0 Kommentare
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!