Mercurial > repos > public > sbplib
diff +anim/setup_1d_plot.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 | b21c53ff61d4 |
children | dbc50fa58ca6 |
line wrap: on
line diff
--- a/+anim/setup_1d_plot.m Thu Nov 12 09:47:04 2015 -0800 +++ b/+anim/setup_1d_plot.m Thu Nov 12 12:03:45 2015 -0800 @@ -1,4 +1,15 @@ -function [update_data,plot_handles] = setup_1d_plot(x,y_lim,yfun) +% Creates a plot and provides a function to update the data in it. +% x - Vector of x-values to plot for. +% y_lim - 1x2 vector containing the y limits of the plot. +% yfun - Function or a cell array of functions of y data vectors +% that should be plotted. The output of each function +% will be plotted to the same axis. +% +% update_data(t,varargin) - Function to update plot data. All varargin will +% be passed to functions in yfun. +% plot_handles - Array of plot_handles. One for each yfun. +% axis_handle - Handle to the axis plotted to. +function [update_data, plot_handles, axis_handle] = setup_1d_plot(x,y_lim,yfun) default_arg('yfun',{@(y)y}); if isa(yfun,'function_handle')