diff +anim/setup_1d_plot.m @ 200:ef41fde95ac4 feature/beams

Merged feature/grids into feature/beams.
author Jonatan Werpers <jonatan@werpers.com>
date Mon, 13 Jun 2016 16:59:02 +0200
parents df83c8095326
children
line wrap: on
line diff
--- a/+anim/setup_1d_plot.m	Mon Feb 29 15:40:34 2016 +0100
+++ b/+anim/setup_1d_plot.m	Mon Jun 13 16:59:02 2016 +0200
@@ -9,8 +9,9 @@
 %                             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,yfun)
+function [update_data, plot_handles, axis_handle] = setup_1d_plot(x,yfun,show_title)
     default_arg('yfun',{@(y)y});
+    default_arg('show_title', true)
 
     if isa(yfun,'function_handle')
         yfun = {yfun};
@@ -24,8 +25,6 @@
 
     axis_handle = gca;
 
-    xlabel('x')
-    ylabel('y')
     xlim([x(1) x(end)]);
 
     function update(t,varargin)
@@ -33,7 +32,10 @@
             for i = 1:length(yfun)
                 set(plot_handles(i),'YData',yfun{i}(varargin{:}));
             end
-            title(axis_handle,sprintf('T=%.3f',t));
+
+            if show_title
+                title(axis_handle,sprintf('T=%.3f',t));
+            end
         end
     end
     update_data = @update;