Figure double click problem
4 ビュー (過去 30 日間)
古いコメントを表示
Using R2014b, I created a gui that allows users to select any number of variables to plot in a single figure (1 subplot). I set zoom on and hold on.
I included a uicontrol (popupmenu) within the figure that allows users to select any 1 of the variables to automatically 'zoom in' on. In my case, there could be variables plotted that have Ylims of +/-.05 or +/-10^30, and these variables could be plotted together, so the uicontrol reads the X/Y lims of the selected variable and sets the axis X/YLims to be 10% larger than those values.
This works very well with one exception: I'd like a user "double-click" to return the axis to it's original X/Y lims, similar to what happens when a manual zoom takes place.
In my case, I get the following behavior:
1) if I create a new figure from the gui and then click at least once anywhere in the axes (single or double click), THEN select a variable to zoom in on using the uicontrol, any following double click will always return the axes limits to the original values (desired behavior).
2) If I create a new figure from the gui and immediately use the uicontrol to zoom in on a variable, the X/Y limits of this zoom are used as the "return-to size" when any following double click takes place. (NOT desired behavior)
In other words, Matlab uses the X/Y Limits existing when the first figure 'click' takes place to use as the default axes size.
Is there any way to save the original figure size (ButtonDownFcn?) when the user hasn't clicked in the axes yet?
I did include a setting in the uicontrol that can be selected to size all variables, but this is not ideal or completely user-friendly.
0 件のコメント
回答 (1 件)
参考
カテゴリ
Help Center および File Exchange で Migrate GUIDE Apps についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!