Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update function #2

Open
LG1990 opened this issue Feb 4, 2017 · 1 comment
Open

Update function #2

LG1990 opened this issue Feb 4, 2017 · 1 comment

Comments

@LG1990
Copy link

LG1990 commented Feb 4, 2017

Hello, thank you for your awesome script. Just one question: I'm plotting data incoming from a device every 100 ms, and the simple plot function get slower and slower with time.
So I tried reduce_plot, but I'm not able to recursively update the plot.

my code works like this.

% define timer
timer('Period',0.1,'TimerFcn',@TimerClbk)

function TimerClbk(hObject,event)
l = get(h.axis,'Children')
if isempty(l)
% if no plot is present, plot the data
rp = reduce_plot(h.axis,X,Y)
else
% otherwise update the data
set(rp,'XData',newX,'YData',newY)
end

it always stays the same...
am I doing it right?

@tuckermcclure
Copy link
Owner

Sorry, @LG1990! I'm only just now finding this issue! I'm afraid these tools won't work well for updating the material in a plot over time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants