現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
How to put an axes into the foreground layer in GUI (made by GUIDE)?
6 ビュー (過去 30 日間)
古いコメントを表示
Csaba
2018 年 5 月 10 日
I have a GUI with several axes defined. When running the program I would like to select an axes and enlarge or move it inside the figure window. I can do it with the selection tool. However the layer position of individual axes depend on the order defined in the GUIDE, when I was designing the figure window. I cannot change it when the program is running. So the axes is enlarged behind another axes, and therefore they are not visible properly.
How to put axes into foreground when I am running the program?
回答 (2 件)
Walter Roberson
2018 年 5 月 10 日
uistack() works on axes.
13 件のコメント
Csaba
2018 年 5 月 15 日
編集済み: Csaba
2018 年 5 月 15 日
Thanks, it is working, although I have found another solution: "axes(axes_handle)".
Although I have a problem with it. When "plotedit" property is on for the figure (you need it for selecting the proper axes and I have a toolbar icon for it), I cannot use ButtonDownFcn of that axes. The callback is simply not executed. So If I really want to change the size of an axes, first I have to click on it while "plotedit" is off, then switch plotedit to on and then you can resize the axes. It is ugly.
Any suggestions???
Walter Roberson
2018 年 5 月 15 日
Those modes are not compatible. plot edit needs control over all of the clicks.
You could use axes or figure button down fcn callbacks to select the axes, but at the moment no good method for interactively resizing an axes is coming to mind.
Walter Roberson
2018 年 5 月 15 日
It is quite unlikely that this will ever be implemented in GUIDE. GUIDE is only being maintained if changes to MATLAB make its internal code incompatible. All of the effort is being placed in App Designer. GUIDE will be retired when App Designer has been expanded for all of the major functionality that GUIDE has now.
Csaba
2018 年 5 月 16 日
I do not see what GUIDE has to do in this case. The figure window with several axes can be done without GUIDE. Then the same problem exists.
It is not a GUIDE problem.
Csaba
2018 年 5 月 16 日
I think "plotedit" should contain an option in the toolsmenu "bring to front" "send to back" etc.
Jan
2018 年 5 月 16 日
編集済み: Jan
2018 年 5 月 16 日
@Csaba: You are right. I've removed my comment to avoid confusing readers.
If all you want to do is to resize/move the axes, what about using a context menu to start this? I'm not sure, if the function from the plotedit tools can be reused directly, but you can search where it is triggered by using the profiler: profile on, then select the axes and resize it, profile report. Maybe it is not possible to call this tool directly. But you could write your own resize function for an axes object. The older function selectmoveresize was useful, but now plotedit is recommended, although this is an indirection.
Walter Roberson
2018 年 5 月 16 日
"I do not see what GUIDE has to do in this case"
You used GUIDE in your title, and you specifically referred to layering order created by GUIDE.
plotedit was designed for HG1, and ignores figures created by the new App Designer.
Csaba
2018 年 5 月 16 日
編集済み: Csaba
2018 年 5 月 16 日
@Walter: Yes, it is true, but later, as we discussed the problem, it turned out that GUIDE has nothing to do with it. By now I have made a pilot program programmatically, reproducing the same behaviour. I can bring forward with ButtonDownFcn any axes, but plotedit should be off. Then I have to change to plotedit on and resize. It is still ugly. I can improve it a little bit including the plotedit on command into ButtonDownFcn Callback, but then I have to switch plotedit off again. AND it is not necessarily the object I have clicked on is selected by plotedit. And I always forget to switch it off! (Silly me!)
I am not familiar with App Designer so I cannot comment on it. I do not know if the same problem exists there or not. If you are sure that my problem can be solved in App Designer I will be happy (may be not) to learn it.
Walter Roberson
2018 年 5 月 16 日
The problem is not solved in App Designer because plotedit cannot be used with App Designer.
The efforts for graphics tools are being directed to App Designer.
The limitation has to do with the fact that the plot editor UI Mode Manager takes over callbacks, including axes button down functions, temporarily disabling whatever button down function you might have programmed. This is because there is no separate callback for left-mouse and right-mouse, so the plot editor cannot put in a right-mouse editor menu without affecting use of left-mouse. And besides, axes button down fcn are defined to fire on all mouse buttons, with it being up to the user to define behavior for specific buttons if they want to.
I posted a work-around for HG1 for R2014a and before. Yair posted an update for HG2 in his http://undocumented-matlab.com . I do not happen to recall limitations after Yair's hacks.
Csaba
2018 年 5 月 16 日
"The problem is not solved in App Designer because plotedit cannot be used with App Designer."
It means that you cannot resize objects in App designer?
Walter Roberson
2018 年 5 月 16 日
I do not know at the moment if you can resize objects in App Designer. The question at hand is whether you can use plotedit with App Designer, as you are locked into using plotedit in your workflow.
Csaba
2018 年 5 月 16 日
What I really want is to select an axes from many in a figure and resize it. plotedit is just a tool for resizing. And, of course, I want to put it in the foreground because otherwise you cannot see what you just made bigger because it is hidden below other axes.
So any solutions are welcome. I am not locked to plotedit.
Jan
2018 年 5 月 17 日
2 件のコメント
Csaba
2018 年 5 月 25 日
OK, I have checked axshift. As it is, it is not very good, i.e. in some cases (i.e. when I click to a subplot) it flickers, I have to use the figure(x) figure, but not the GUIDE figure, in order to resize the subplot, I need to go to a right click menu.
Still the best would be a "send to back", "send to front" kind of right click command in plotedit.
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
アジア太平洋地域
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)