Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

Make the location of bar graph in axes 1??

1 visualización (últimos 30 días)
Mahirah Hamdan
Mahirah Hamdan el 27 de Abr. de 2014
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
meanall=[meantheta,meanalpha,meanbeta];
color_map={'r','b','y'};
for i=1:3
bar(i, meanall(i),'facecolor',color_map{i});
hold on
end
hold off
this is my code in gui presenting the bar graph of meanall in different color. The problem is, my gui contains many axes and i want to locate this bar graph in axes 1. What should i add into my code?

Respuestas (1)

Geoff Hayes
Geoff Hayes el 27 de Abr. de 2014
Hi Mahirah,
If you know the handle to the axes ( axes1_handle ) that you wish to add the bar graph to, you can do so as follows:
bar(axes1_handle,i,meanall(i),);
Please see bar for details.
Geoff
  2 comentarios
Mahirah Hamdan
Mahirah Hamdan el 27 de Abr. de 2014
i have try it, but the bar graph only show the last data which is meanbeta
Geoff Hayes
Geoff Hayes el 27 de Abr. de 2014
Try using the hold on command to keep all bar graphs displayed on the axes. Run help hold from the command line for details.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by