comparison arrows/@plotter/plotter.m @ 0:672052bd81f8

Initial partial import.
author samer
date Wed, 19 Dec 2012 22:38:28 +0000
parents
children 3f77126f7b5f
comparison
equal deleted inserted replaced
-1:000000000000 0:672052bd81f8
1 % plotter - Arrow for doing plots.
2 %
3 % plotter :: options {
4 % dom :: [[N]->nonneg] / (1:N) ~'X values for plots';
5 % ylim :: [[_]->nonneg] / [] ~'passed to ylim if not empty';
6 % xlim :: [[_]->nonneg] / [] ~'passed to xlim if not empty';
7 % xlabel :: [[_]->nonneg] / [] ~'passed to xlabel if not empty';
8 % ylabel :: [[_]->nonneg] / [] ~'passed to ylabel if not empty';
9 % plotfn :: plotfn / @plot ~'function to create image';
10 % args :: {[_]} / {} ~'extra arguments for plotfn'
11 % } -> arrow({[[N,M]]}, {}, empty) ~'arrow from 2D arrays'.
12 %
13 % plotter is an arrow which displays each input array as line plots
14 % using plot by default. The essential thing about plotter is that
15 % the graphics must be updated by setting the 'YData' property of
16 % the handle graphics object returned by the plotting function.
17
18 function o=plotter(varargin)
19 s.opts=prefs('dlim',[],'dom',[],'ylim',[],'xlim',[],'plotfn',@plot,'args',{},'tranpose',0,varargin{:});
20 if isempty(s.opts.ylim), s.opts.ylim=s.opts.dlim; end
21 o=class(s,'plotter',agraph(1,s.opts));
22 end
23