manually specify occourrences in bar graph
Afficher commentaires plus anciens
Hi everyone, i have analyzed some data and now i want to make an histogram,but i can't understand how i can do it.Let me explain, i have 4 values and for each value 2 characteristics: entropy and bandwidth: 1) first value, entropy=1.8 and bandwidth = 18 2) second value, entropy = 0.9 and bandiwidth = 26 ecc...
my aim is to have in x axes my values and y axes the characteristics' value(with different colors)
(if there are others ways to do this,it's ok)
thank you!(and forgive my english)
3 commentaires
Image Analyst
le 18 Jan 2013
A histogram with only 4 values? Are you kidding me? Perhaps you mean some other kind of graph/plot/visualization instead of a histogram (which is an array of the frequency of occurrence, like a probability density function).
Image Analyst
le 18 Jan 2013
Oh, you mean just a bar chart, not a histogram. Even though histograms are often plotted using a bar chart, all bar charts don't depict histograms.
Réponses (2)
Sample values
values = [1:4];
entropy = [1.8 1.9 2.1 2.2];
bandwidth = [18 2 10 11];
Plot the bars
h = bar(values, [entropy; bandwidth]');
Color them red and blue:
set(h(1), 'FaceColor', 'r')
set(h(2), 'FaceColor', 'b')
BTW: Please edit your question and remove the histogram stuff such that others can understand my answer...
Catégories
En savoir plus sur Data Distribution Plots dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!