Mercurial > repos > public > sbplib
diff +anim/updatableLine.m @ 56:ce90abc350c5
Added documentation to setup_1d_plot. Added updatableLine.m
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Thu, 12 Nov 2015 12:03:45 -0800 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/+anim/updatableLine.m Thu Nov 12 12:03:45 2015 -0800 @@ -0,0 +1,15 @@ +function [update_data, line_handle] = updatableLine() + figure_handle = gcf; + axis_handle = gca; + + line_handle = line(0,0); + + function update(x,y) + if ishandle(figure_handle) && ishandle(axis_handle) + set(line_handle,'XData',x); + set(line_handle,'YData',y); + drawnow + end + end + update_data = @update; +end \ No newline at end of file