Mercurial > repos > public > sbplib
comparison +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 |
comparison
equal
deleted
inserted
replaced
47:ebd25e5a481a | 48:b21c53ff61d4 |
---|---|
1 function [update_data,figure_handle,plot_handles] = setup_1d_plot(x,y_lim,yfun) | 1 function [update_data,plot_handles] = setup_1d_plot(x,y_lim,yfun) |
2 default_arg('yfun',{@(y)y}); | 2 default_arg('yfun',{@(y)y}); |
3 | 3 |
4 figure_handle = figure; | 4 if isa(yfun,'function_handle') |
5 yfun = {yfun}; | |
6 end | |
7 | |
8 figure_handle = gcf; | |
5 plot_handles(1) = plot(x,0*x); | 9 plot_handles(1) = plot(x,0*x); |
6 hold on | 10 hold on |
7 for i = 2:length(yfun) | 11 for i = 2:length(yfun) |
8 plot_handles(i) = plot(x,0*x); | 12 plot_handles(i) = plot(x,0*x); |
9 end | 13 end |