Mercurial > repos > public > sbplib
diff +anim/setup_1d_plot.m @ 48:b21c53ff61d4
Made setup_1d_plot behave more like matlabs plot().
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Thu, 05 Nov 2015 16:31:53 -0800 |
parents | 48b6fb693025 |
children | ce90abc350c5 |
line wrap: on
line diff
--- a/+anim/setup_1d_plot.m Thu Nov 05 16:30:17 2015 -0800 +++ b/+anim/setup_1d_plot.m Thu Nov 05 16:31:53 2015 -0800 @@ -1,7 +1,11 @@ -function [update_data,figure_handle,plot_handles] = setup_1d_plot(x,y_lim,yfun) +function [update_data,plot_handles] = setup_1d_plot(x,y_lim,yfun) default_arg('yfun',{@(y)y}); - figure_handle = figure; + if isa(yfun,'function_handle') + yfun = {yfun}; + end + + figure_handle = gcf; plot_handles(1) = plot(x,0*x); hold on for i = 2:length(yfun)