Why do plotting functions like bar or barh take a long time to execute?
Mostrar comentarios más antiguos
I have a 1x600 vector of doubles, where each element represent the duration of a certain engineering process. I want to get a horizontal stacked bar graph which shows the duration of each process sequentially. For that I am using the following code
BHd --> 1x600 vector
BHd = [zeros(length(BHd),1), BHd];
figure(3)
barh(BHd', 'stacked');
However, I noticed that it takes a long time for barh function to run in this case (58.2 s). Are there any alternative ways of plotting the stacked bar graphs, that would take less time?
The plots should have the following format.

Btw, I am running MATLAB2017b on my computer
3 comentarios
You can do more or less the same ting with lines, instead of patches. See here.
You just increase the line width, and it looks like a bar. You can also plot the edges as a continous line.
theblueeyeswhitedragon
el 9 de Ag. de 2018
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Discrete Data Plots en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!