matplotnode
C++ bindings for Node.js exposing a subset of matplotlib's functionality through the CPython API. Inspired by matplotlib-cpp by lava. Useful for scientific plotting.
Requirements
- Python 2.7 (might work on Python 3, not tested yet)
- matplotlib
Usage
$ npm install matplotnode
const plt = require('matplotnode');
Bindings
*See how kwargs
are implemented in test.js
Example
const plt = require('matplotlib');
const x = new Array(100).fill(0).map((x, i) => i / Math.PI);
plt.subplot('211');
plt.plot(x, x.map(Math.sin), 'color=r', 'label=sin(x)');
plt.plot(x, x.map(Math.cos), 'color=g', 'label=cos(x)');
plt.legend();
plt.subplot('212');
plt.plot(x, x.map(Math.tan), 'color=b', 'label=tan(x)', 'marker=o', 'linestyle=None');
plt.legend();
plt.grid(true);
plt.ylim(-5, 5);
plt.save('./examples/subplot.png');

const plt = require('matplotlib');
const x = new Array(100).fill(0).map((x, i) => i / Math.PI);
plt.plot(x, x.map(Math.sin));
plt.grid(true);
plt.show();
