Change axes limits interactively
Mostrar comentarios más antiguos
Hi everybody,
I would like to change the axes limits of my 2D plots in my GUI interactively. This means that it want to click on one of the axes limits (min/max at x or y), then enter a new limit and finally automatically refresh the plot. In other software (e.g. LabVIEW), this functionality is available by default. However, in MATLAB it seems to require a work-around. I already got the hint to try the 'ButtonDownFcn' callback and the 'CurrentPoint' function. However, right now I am struggling to enter the text. If this would work, it should be straight forward as I could simply execute a set('xLimÄ',...) command with the exact same limit I entered as a text before. Therefore, I'd like to ask if anybody knows how to enter text at the location of the 'CurrentPoint'.
Thank you very much for you help!
Best regards, Johannes
2 comentarios
AstroGuy1984
el 25 de Abr. de 2017
I'm confused as to how you wish to query the user for the new limit? Is the idea that the user clicks the axis and gets a prompt to enter the new limit they want? How do you wish that prompt to appear? A popup? In the shell? Once you get that, you can certainly use the set() command you're desiring to use.
As another option, I have a similar need for interactive limits in a GUI I am writing. What I did is to make several fields (four of them) where the user can enter the limits as they desrie and the plot automatically updates. I also have buttons for log/lin scale which are useful for my purposes.
Johannes
el 26 de Abr. de 2017
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Axes Appearance 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!
