Plotting 2 arrays as bar charts with adjacent bars
7 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Murtaza Mohammadi
el 15 de Nov. de 2022
Comentada: Murtaza Mohammadi
el 18 de Nov. de 2022
I have two arrays A and B, each of 8 elements. I want to plot them as bar charts with each corresponding element plotted as adjacent bars. The bar tool overlaps and makes it difficult to handle the properties. The target is something like this (see image).
Thank you
0 comentarios
Respuesta aceptada
VBBV
el 15 de Nov. de 2022
A = rand(1,8);
B = rand(1,8);
bar([1 2 3 4 5 6 7 8],[A;B]); % use concatenation
Más respuestas (1)
Ver también
Categorías
Más información sobre Bar Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!