changeset 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 ebd25e5a481a
children 8f0c2dc747dd
files +anim/setup_1d_plot.m
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
diff -r ebd25e5a481a -r b21c53ff61d4 +anim/setup_1d_plot.m
--- 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)