You are now following this question
- You will see updates in your followed content feed.
- You may receive emails, depending on your communication preferences.
Line disappearing when zooming in a UIFigure
4 views (last 30 days)
Show older comments
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 Comments
Daniel Ko
on 1 Sep 2019
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
on 2 Sep 2019
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.
Adam Danz
on 3 Sep 2019
Edited: Adam Danz
on 12 Dec 2019
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
lihiniya
on 11 Sep 2019
Edited: lihiniya
on 11 Sep 2019
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
on 11 Sep 2019
Edited: Bruno Luong
on 11 Sep 2019
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) !
Bruno Luong
on 11 Sep 2019
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
on 11 Sep 2019
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
on 12 Dec 2019
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
on 11 Mar 2020
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
on 27 Mar 2020
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
on 30 Mar 2020
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
Answers (0)
See Also
Categories
Find more on Develop uifigure-Based Apps in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- 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)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)