-
-
Notifications
You must be signed in to change notification settings - Fork 809
/
Copy pathlinestyles
executable file
·51 lines (45 loc) · 980 Bytes
/
linestyles
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/env node
'use strict';
var randn = require( '@stdlib/random/base/box-muller' );
var Float64Array = require( '@stdlib/array/float64' );
var Plot = require( './../lib' );
var plot;
var opts;
var y1;
var y2;
var y3;
var y4;
var x;
var i;
// Create some data...
x = new Float64Array( 100 );
y1 = new Float64Array( x.length );
y2 = new Float64Array( x.length );
y3 = new Float64Array( x.length );
y4 = new Float64Array( x.length );
for ( i = 0; i < x.length; i++ ) {
x[ i ] = i;
y1[ i ] = 10.0 + (5.0*randn());
y2[ i ] = 25.0 + (7.25*randn());
y3[ i ] = 50.0 + (10.0*randn());
y4[ i ] = 75.0 + (2.5*randn());
}
// Set the plot options:
opts = {
'width': 600,
'height': 480,
'colors': '#000',
'lineOpacity': 0.5,
'lineWidth': 1,
'lineStyle': [
'-', // solid
'--', // dashes
':', // dotted
'-.' // dash-dot
],
'viewer': 'window'
};
// Create a new plot:
plot = new Plot( [ x, x, x, x ], [ y1, y2, y3, y4 ], opts );
// View the plot:
plot.view();