~ubuntu-branches/ubuntu/intrepid/plplot/intrepid

« back to all changes in this revision

Viewing changes to examples/c/x17c.c

  • Committer: Bazaar Package Importer
  • Author(s): Rafael Laboissiere
  • Date: 2006-11-04 10:19:34 UTC
  • mfrom: (2.1.8 edgy)
  • Revision ID: james.westby@ubuntu.com-20061104101934-mlirvdg4gpwi6i5q
Tags: 5.6.1-10
* Orphaning the package
* debian/control: Changed the maintainer to the Debian QA Group

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: x17c.c,v 1.16 2002/12/03 08:39:24 airwin Exp $
 
1
/* $Id: x17c.c,v 1.21 2006/05/27 20:46:43 hbabcock Exp $
2
2
 
3
3
 * Plots a simple stripchart with four pens.
4
4
 */
5
5
 
6
6
#include "plcdemos.h"
 
7
#include <stdlib.h>
7
8
#ifdef HAVE_UNISTD_H
8
9
# include <unistd.h>
9
10
#else
12
13
# endif
13
14
#endif
14
15
 
 
16
 
 
17
 
15
18
/* Variables for holding error return info from PLplot */
16
19
 
17
20
static PLINT errcode;
24
27
int
25
28
main(int argc, char *argv[])
26
29
{
27
 
    PLINT id1, id2, n, autoy, acc, nsteps = 1000;
 
30
    PLINT id1, n, autoy, acc, nsteps = 1000;
28
31
    PLFLT y1, y2, y3, y4, ymin, ymax, xlab, ylab;
29
32
    PLFLT t, tmin, tmax, tjump, dt, noise;
30
33
    PLINT colbox, collab, colline[4], styline[4];
31
 
    char *legline[4], toplab[20];
32
 
    double drand48(void);
 
34
    char *legline[4];
33
35
 
34
36
/* plplot initialization */
35
37
/* Parse and process command line arguments */
36
38
 
37
 
    (void) plParseOpts(&argc, argv, PL_PARSE_FULL);
 
39
    (void) plparseopts(&argc, argv, PL_PARSE_FULL);
38
40
 
39
41
/* If db is used the plot is much more smooth. However, because of the
40
42
   async X behaviour, one does not have a real-time scripcharter.
129
131
# endif
130
132
#endif
131
133
        t = (double)n * dt;
132
 
        noise = drand48() - 0.5;
 
134
        noise = ((double)rand()/(RAND_MAX+1.0)) - 0.5;
133
135
        y1 = y1 + noise;
134
 
        y2 = sin(t*PI/18.);
 
136
        y2 = sin(t*M_PI/18.);
135
137
        y3 = y2 * noise;
136
138
        y4 = y2 + noise/3.;
137
139
 
155
157
    plend();
156
158
    exit(0);
157
159
}
 
160