Changing xlim & ylim of axes sluggish
5 ビュー (過去 30 日間)
古いコメントを表示
I implemented my own pan & zoom functionality which adjusts the xlim & ylim of an axes as the user moves the mouse. Although this works OK, it's a bit sluggish & "laggy". I'm guessing that the data coming from the mouse is overwhelming the systems ability to change the axes properties.
Does this sound reasonable? If so, does the axes have a "busy updating" flag I can test? Or is there some other explanation?
Any ideas?
TIA
Dan
3 件のコメント
José-Luis
2013 年 12 月 18 日
That might the source of your problem. The image is re-plotted every time you refresh your axes. Please try with fewer data to see if that's the problem.
回答 (2 件)
David Sanchez
2013 年 12 月 18 日
You have too many processes trying to run at the same time. Even when it sounds incoherent, insert a very short pause right after reading the mouse position
pause(0.0001);
That will refresh the buffer ( or something like that ) and the graphics will be plotted less "laggy".
Kelly Kearney
2013 年 12 月 20 日
Not sure if this is exactly the effect you're going for, but for panning around an image via mouse movement, I've found this function: zoom2cursor to be very well-done, and I've used that code as a template to pan around some very large images without any noticeable latency.
参考
カテゴリ
Help Center および File Exchange で Graphics Performance についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!