File tree 2 files changed +8
-2
lines changed
2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,7 @@ The following properties can be used:
59
59
- ` style ` : _ The style of the lines on the graph. Possibilites include
60
60
` lines ` (default), ` points ` and ` linespoints ` _
61
61
- ` nokey ` : _ Disables the graph key_
62
+ - ` x_begin ` : _ Specifies the starting point along X axis on the graph_
62
63
63
64
The following example shows these in use:
64
65
71
72
logscale: true ,
72
73
xlabel: ' time' ,
73
74
ylabel: ' length of string' ,
74
- format: ' pdf'
75
+ format: ' pdf' ,
76
+ x_begin: 0
75
77
});
76
78
```
77
79
Original file line number Diff line number Diff line change @@ -160,6 +160,10 @@ function plot(options) {
160
160
options . style = 'lines' ; /* Default to lines */
161
161
}
162
162
163
+ if ( ! options . x_begin ) {
164
+ options . x_begin = 0
165
+ }
166
+
163
167
/* Apply moving averages and maximums */
164
168
if ( options . moving_avg ) {
165
169
options . data = apply_moving_filter ( options . data , moving_average , options . moving_avg ) ;
@@ -211,7 +215,7 @@ function plot(options) {
211
215
/* Print out the data */
212
216
for ( i = 0 ; i < series . length ; i += 1 ) { /* For each series */
213
217
for ( key in options . data [ series [ i ] ] ) {
214
- gnuplot . stdin . write ( key + ' ' + options . data [ series [ i ] ] [ key ] + '\n' ) ;
218
+ gnuplot . stdin . write ( parseInt ( options . x_begin ) + parseInt ( key ) + ' ' + options . data [ series [ i ] ] [ key ] + '\n' ) ;
215
219
}
216
220
/* Terminate the data */
217
221
gnuplot . stdin . write ( 'e\n' ) ;
You can’t perform that action at this time.
0 commit comments