現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
Line disappearing when zooming in a UIFigure
4 ビュー (過去 30 日間)
古いコメントを表示
Daniel Ko
2019 年 8 月 31 日
Hello,
I am using appdesigner to create a way to scan through my time series. When I zoom into the time series however, the line disappears and only comes back when I jiggle around with the pan tool for a while or zoom all the way out using the home button in the interactive plot tool.
Is there a way to stop this from happening? I believe this is something to do with some under-the-hood optimisation going wrong?
After zoom:
Thanks!
21 件のコメント
dpb
2019 年 9 月 1 日
Need to see the code but one Q? Are you using two axes to show the points and the line by any chance? Zooming the one but not the other could end up w/ the second being brought to the foreground and occluding the first. Just a guess w/ nothing else to go on...
Daniel Ko
2019 年 9 月 1 日
I am using the same UIAxes to plot both the lines and the markers. The line does come back eventually if I jiggle the zoomed axes with the pan tool for a bit and the line and the markers do jiggle together so its not that I think.
% blue line
app.pData = line(app.Trace, app.msConvert*(1:size(app.xi,2)),app.xi(app.m.mainCh,:),'Color','b');
hold(app.Trace, 'on')
for ii = app.s.clusters
tempUnit = app.rawSpikeIdx(app.t.spikeClust{app.currentBatch} == str2double(ii));
if ~isempty(tempUnit)
nii = str2double(ii);
% markers with different colour each loop
app.pAssigned(c) = line(app.Trace, tempUnit*app.msConvert, app.xi(app.m.mainCh,tempUnit), ...
'LineStyle', 'none', 'Marker', 'x', 'Color', app.cmap(nii,:));
c = c+1;
end
end
dpb
2019 年 9 月 1 日
Try sticking a drawnow in there somewhere -- I've never done much programmatically w/ zoom and never used UIAxes so am guessing here. Is there a callback for the zoom operation, maybe? Be a place to put it if so...
Daniel Ko
2019 年 9 月 2 日
I am hesitant to add a drawnow to the zoom function (matlab builtin). Not sure where I'd put it if not in there.
dpb
2019 年 9 月 2 日
No, you don't add anything to the ML function, you use one of the builtin callbacks from modifying the figure and put it in your callback function. As said, I've never used UIAxes nor zoom programmatically so I'm not sure just what options are out there, but I'd wager there are some.
Daniel Ko
2019 年 9 月 3 日
It seems like the zoom function does not support UIAxes to have zoom callback functions at this time. Is there a workaround?
Adam Danz
2019 年 9 月 3 日
編集済み: Adam Danz
2019 年 12 月 12 日
Interactive zoom does work with uiaxes - that's how you zoomed into your axes in the first place.
When you zoom in and the lines disappear, you could execute drawnow() from the command window just to test dpb's hunch that it's a graphics glitch.
If the problem is very easy to reproduce, you could attach the app file & data and instructions how to reproduce the problem. Otherwise, maybe move on to tech support.
[update]
Also see this summary of zoom methods in App Designer
Daniel Ko
2019 年 9 月 3 日
I tried the drawnow command in the command window and it does not solve the problem. I will try the tech support.
lihiniya
2019 年 9 月 11 日
編集済み: lihiniya
2019 年 9 月 11 日
I have the exact same problem. I use uiaxes component in app designer and plot a line with considerable large data (1 million or more points). The plot sometimes disaapears when zommed with interactive controls or even when setting XLim manualy. This does not happen always but I cannot find a pattern. If i pan around or zoom-out completely or set the XLimMode='auto' the plot comes back most of the time.
This happens in multiple computers with different hardware (for an example a workstaion with Nvidia graphics and a PC with Intel HD graphics). Does this have someting to do with app designer web gui not handling the large number of data points? AFAIK app designer apps run inside a built-in web-browser with some sort of java-script UI widgets.
Matlab Version 2019a update 5. Has been happening even when I used 2018b.
@Daniel Ko: Were the tech-support able to solve your problem?
Bruno Luong
2019 年 9 月 11 日
編集済み: Bruno Luong
2019 年 9 月 11 日
Hmm, I suspect that there is a huge latency in refreshing, and when you zoom in lines are YET nor drawed, so you have impression that they disappear.
After 5 years of existence, HG2 still has big slowness problem with plotting huge number of markers.
I even observe the tendency that the latency gets more pronounced when user zooms IN (where there is less things to displayed on the screen) !
dpb
2019 年 9 月 11 日
Does the latency show up as inability to do other operations or just the graphics display in background, Bruno?
IOW, is there a way for OP to tell this is the cause?
Bruno Luong
2019 年 9 月 11 日
Hard to tell, because I think MATLAB graphical rendering is in charge by an independent thread and can be triggered by various factors (drawnow is one) and also dependend on the interrutible/busy states of the graphic objects or figure.
The slowness might also depend on zbuffer/painter rendering, perspective or parallel (2D) projection.
Quite a complex beast.
In the worse case I prefer to kill MATLAB (like I just did by playing with some script related to this question).
dpb
2019 年 9 月 11 日
That's kinda' what I was suspecting...not easy to determine root cause.
I've not done anything "in anger" that required really large datasets to have much (as in any) experience with HG2 since I retired from active consulting gig about the time it was introduced. I just piddle here and with some much smaller non-engineering/graphics datasets in some pro bono work these days...
Stephanie
2019 年 12 月 12 日
I'm having a similar issue. I have 5 lines plotted. When I click on a line circle markers are created showing which values where clicked on. When fully zoomed out you can see the lines and the circle(s). But when I zoom in I can still see the lines but the circles vanish. I have not found anything that makes them reappear while zoomed. But if I click the "house" or restore view icon the circles reappear.
Also if I click the zoon in icon. And then unclick it. It does not turn zoom in off. But this does work for zoom out and pan. The zoom in is a problem because after zooming in I would like to click on the line and have the circles be added to the line. But because I can not get zoom in to turn off, when I click on the line it just zooms in again.
Very frustrating.
Steph
Stephanie
2020 年 3 月 11 日
I am having a similar issue. I was able to get a zoomed in view with the symbols still visible by setting the ylim for the axes in the function that runs when I click on the line. But they quickly disappear when you zoom out or try and mess with the zoom in or out. I am going to redo this whole GUI in the good old guide because I need to be able to zoom and see the symbols. It is the way I remove spikes etc and is 90% of the functionality that I need from the GUI. Also the way the app Designer handles clicks makes it hard to do what I am use to being able to do in the guide version of GUIs.
Steph
Stephanie
2020 年 3 月 27 日
r2019b. I've been trying to get help from Matlab but they keep thinking the WindowButtonDownFcn callback is running and deleting the dots. But it is not. I have a lot of display scripts to show it is not running when it is not suppose to. But they keep thinging that is the issue and it is not.
I have tried to do some of their suggestions, like remove the axes toolbar and make a zoom on off button. And I make sure the callback does not run when the zoom is on. An now the problem is worse. Once you zoom in the dots disapear and nothing I do can make them come back. when I had the toolbar the home button made them reappear. Now zooming out full does not make them appear and click on another line correctly runs the plotting function and the x and y data look fine but the dots never show up. So following their suggestions have made it worse not better.
So frustrating. Steph
Stephanie
2020 年 3 月 30 日
An update, I put in a Technical Support report about the issue. After some back and forth they finally figured it out and the dissapearing dots when I zoom no long vanish! I had set the Zdata of the dots to 30 and they suggested 0.9 and they also noted that the 'SortMethod' on the axes was "depth" and I should change it to be "childorder". I am not sure how the 'SortMethod' got to be "depth" because I did not set that property. But doing those two things made my dots stay put when zoom in and out and using the toolbar home item. Hope this helps!
Steph
Daniel Ko
2020 年 5 月 22 日
I am not, the new 2020a update fixed the issue among a lot of other speed improvements.
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Develop uifigure-Based Apps についてさらに検索
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 (한국어)