필터 지우기
필터 지우기

ginput slow when plotted a lot of points

조회 수: 10 (최근 30일)
Marco
Marco 2011년 9월 29일
답변: Marijan Herak 2018년 3월 2일
Hi, i'm experiencing a strange behaviour of the ginput command.
I plotted on an axis quite a huge number of points (more than 4 millions). Everything behaves quickly (pan and zooming are fast).
When i run a ginput on this axis it becomes painfully slow. The crosshair-like pointer is lagged (it follows the actual position of the mouse with a delay of some seconds).
the only solution i found so far is to overlay a transparent axis over the real one, with the same extents, and run the ginput over this second one.
This solution actually works but is really slow to code (i often have to do it) and could cause some problems (e.g in case of zooming it's quite difficult to keep the axis aligned).
In general i don't think this solution is elegant, so my question is:
did anyone else experience the same problem and find a better solution or workaround?
Thanks!
Marco
  댓글 수: 1
Paolo
Paolo 2013년 8월 14일
Hi Marco, could you please write the lines of code that you used to overlay a transparent axis with aligned axes? I'm experiencing the same problem with ginput...
Thanks, Paolo

댓글을 달려면 로그인하십시오.

답변 (3개)

Walter Roberson
Walter Roberson 2011년 9월 29일
linkaxes() should keep the axes aligned.
If you have to code it often, then it would seem natural to code the repeated elements in to functions and then just call upon them ?
  댓글 수: 1
Marco
Marco 2011년 9월 29일
First of all thanks for the suggestion, that's exactly what i will do if the overlaying a second axis is the only possible way to have the ginput work swiftly.
i just think it's strange that the number of points previously drawn affects the performances of such a function and that i have to code a solution (or more precisely a workaround) to a problem that in my opinion should not be there.

댓글을 달려면 로그인하십시오.


Marijan Herak
Marijan Herak 2018년 3월 2일
Try choosing OpenGL renderer for the figure - set(gcf,'renderer','opengl'). It works for me, and ginput is smooth and responsive again (over 100.000 points in the figure).

Marco
Marco 2011년 10월 4일
This seems to be the only solution, so i thank a lot Walter for the time he dedicated to me and i positively rate his answer!
  댓글 수: 2
Walter Roberson
Walter Roberson 2011년 10월 4일
Perhaps you could simply turn hittest off in the properties of the handles for the points?
Philippe
Philippe 2012년 7월 19일
That worked for me. ginput is very fluid with the HitTest off.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by