
how to create multiple bar chart??
6 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
ARYA NAYAK
il 24 Dic 2016
Commentato: Image Analyst
il 26 Dic 2016
when selecting two or more charts using popup menu like choosing 2 for 2 charts. how to create a code in script??
0 Commenti
Risposta accettata
Image Analyst
il 24 Dic 2016
Try this:
numCharts = 20;
% Prepare menu
for k = 1 : numCharts
choices{k} = {num2str(k)};
end
buttonNumber = menu('How many charts do you want?', choices)
rows = ceil(sqrt(buttonNumber));
cellContents = str2double(choices{buttonNumber})
for k = 1 : cellContents
% Make a plot
subplot(rows, rows, k);
% Put stuff in it.
data = 100*rand*rand(1,32);
bar(data, 'BarWidth', 1, 'EdgeColor', 'none');
grid on;
end

4 Commenti
Image Analyst
il 26 Dic 2016
Take a look at the histogram() function. You can pass in x and count data and it will plot them. Call hold on and call histogram again if you want multiple bar series. Or maybe it can do it all in one call - I'd have to read the help carefully.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Bar Plots in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!