Borrar filtros
Borrar filtros

GUI Plotting "hold on" problem

4 visualizaciones (últimos 30 días)
John
John el 9 de Nov. de 2011
So my GUI contains two axes and multiple checkboxes. If the user checks on a checkbox part of the corresponding data for that checkbox is graphed in one axis while the other half is graphed in the other axis. This works fine. The problem I am having is that when the user selects another checkbox whatever was graphed before is cleared and the new set of data is plotted only. I have tried using the "hold on" feature however for some reason this distorts the x and y scale of my axes (the graphs I am using are loglog and by using "hold on" they get distorted to a regular plot scale) Please help .
p1 = loglog(handles.inplane_graph,freq,ip_yvalues_accep,'g',freq,ip_yvalues_proto,'b');
p2 = loglog(handles.outofplane_graph,freq,oop_yvalues_accep,'g',freq,oop_yvalues_proto,'b');
hold on
So I added the above code in one of my checkboxes, however now when the other checkbox is checked, my 'outofplane_graph' is the only axes that actually holds on to whatever was graphed before it. My 'inplane_graph' axes deletes whatever was graphed before it and graphs the new set of data. I want both of my axes to hold on. Any ideas?

Respuesta aceptada

Fangjun Jiang
Fangjun Jiang el 9 de Nov. de 2011
Do you mean just "hold on" command will distort the scale, or the new plots added changed the scale? You can always change the scale as you want using axis(), xlim(),ylim() if the scale is changed due to the added new plots.
f=figure(1);
loglog(1:10000);
hold on;
plot(10000:-1:1);
xlim([1 10000]);
  3 comentarios
Fangjun Jiang
Fangjun Jiang el 9 de Nov. de 2011
Use hold(axes_handle,'on')
John
John el 9 de Nov. de 2011
yep I did this right before you recommended it to me haha. Thank you though.

Iniciar sesión para comentar.

Más respuestas (1)

Walter Roberson
Walter Roberson el 9 de Nov. de 2011
Try using "hold all" instead of just "hold on".

Categorías

Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by