Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ The following properties can be used:
- `style` : _The style of the lines on the graph. Possibilites include
`lines` (default), `points` and `linespoints`_
- `nokey` : _Disables the graph key_
- `options` : _Sets extra option parameters_

The following example shows these in use:

Expand All @@ -71,7 +72,8 @@ plot({
logscale: true,
xlabel: 'time',
ylabel: 'length of string',
format: 'pdf'
format: 'pdf',
options: ['xrange [0:120]', 'yrange [1000:2500]'],
});
```

Expand Down
9 changes: 8 additions & 1 deletion plotter.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,14 @@ function setup_gnuplot(gnuplot, options) {
if (options.ylabel) {
gnuplot.stdin.write('set ylabel "'+options.ylabel+'"\n');
}


/* Set extra option parameters */
if (options.options) {
for (var i = 0; i < options.options.length; i += 1) {
gnuplot.stdin.write('set '+options.options[i]+'\n');
}
}

/* Setup ticks */
gnuplot.stdin.write('set grid xtics ytics mxtics\n');
gnuplot.stdin.write('set mxtics\n');
Expand Down