~uhh-ssd/+junk/humidity_readout

« back to all changes in this revision

Viewing changes to plplot/plplot-5.9.9/examples/octave/p11.m

  • Committer: Joachim Erfle
  • Date: 2013-07-24 13:53:41 UTC
  • Revision ID: joachim.erfle@desy.de-20130724135341-1qojpp701zsn009p
initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
## Copyright (C) 1998-2003 Joao Cardoso.
 
2
## 
 
3
## This program is free software; you can redistribute it and/or modify it
 
4
## under the terms of the GNU General Public License as published by the
 
5
## Free Software Foundation; either version 2 of the License, or (at your
 
6
## option) any later version.
 
7
## 
 
8
## This program is distributed in the hope that it will be useful, but
 
9
## WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
11
## General Public License for more details.
 
12
##
 
13
## This file is part of plplot_octave.
 
14
 
 
15
function p11
 
16
 
 
17
  global pl_automatic_replot
 
18
  t = pl_automatic_replot;
 
19
  pl_automatic_replot = 0;
 
20
 
 
21
  title("Stripchart demo 1 (sliding)");
 
22
  xlabel("Time");
 
23
  ylabel("Sliding");
 
24
 
 
25
  legend("on", 0.75,0.75);
 
26
 
 
27
  id1 = stripc(0, 10, 0.3, -1, 1, "sin", "cos", "sin+noi", "cos+noi", 0, 0);
 
28
 
 
29
  y1 = 0.0;
 
30
 
 
31
  for t = 0:0.1:5*pi
 
32
    for i=1:1000;endfor    # small delay
 
33
    noise = randn;
 
34
    y1 = sin(t);
 
35
    y2 = cos(t);
 
36
    y3 = 1+y1 + noise/3;
 
37
    y4 = -1+y2 + noise/4;
 
38
    
 
39
    ## there is no need for all pens to have the same number of points
 
40
    ## or beeing equally time spaced.
 
41
 
 
42
    stripc_add(id1, 0, t, y1);
 
43
    stripc_add(id1, 1, t, y2);
 
44
    stripc_add(id1, 2, t, y3);
 
45
    stripc_add(id1, 3, t, y4);                  
 
46
    pleop;      
 
47
  endfor
 
48
 
 
49
  ## Destroy strip chart and it's memory */
 
50
 
 
51
  stripc_del(id1);
 
52
  pl_automatic_replot = t; 
 
53
 
 
54
endfunction