이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
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!오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 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 (한국어)