Axis location in a GUI axes object
Mostrar comentarios más antiguos
I'd like to create an axes object in a GUI, with both axes located at the origin. In a conventional plot, I set the XAxisLocation property to 'origin', but in the GUI it seems only 'top' or 'bottom', (or 'left' or 'right' for y-axis) can be used. Is there a solution to my problem?
Respuestas (2)
Walter Roberson
el 15 de Dic. de 2016
Editada: Walter Roberson
el 15 de Dic. de 2016
0 votos
In MATLAB, "figure" and "GUI" are the same thing, so if you are able to use 'origin' in an "conventional plot" then really you are using it in a GUI. Adding uicontrol to a figure does not change what can be drawn in the figure.
Are you possibly referring to some limitation in GUIDE, or in appdesigner ? If you are referring to a limitation in GUIDE, then in your code after you draw into the axis you can set the properties of the axis. (I was going to say you could put it into the axes CreateFcn callback, but axes properties have a tendency to disappear when you draw in the axes.)
fulvio schettino
el 15 de Dic. de 2016
Editada: Walter Roberson
el 15 de Dic. de 2016
5 comentarios
Walter Roberson
el 15 de Dic. de 2016
Editada: Walter Roberson
el 15 de Dic. de 2016
Could you try this test interactively:
ax = gca;
plot(ax, randn(1,20));
set(ax,'ButtonDownFcn',@(sec,obw) set(ax,'XAxisLocation','origin'));
and then go and click in the axes. Does the origin change?
Perhaps you could attach your code and .fig file?
fulvio schettino
el 16 de Dic. de 2016
Editada: fulvio schettino
el 16 de Dic. de 2016
Walter Roberson
el 17 de Dic. de 2016
R2015b was the version version that supported 'origin' for axes locations.
fulvio schettino
el 17 de Dic. de 2016
Walter Roberson
el 17 de Dic. de 2016
Categorías
Más información sobre Graphics Object Properties en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!