davvo / node-gnuplot Goto Github PK
View Code? Open in Web Editor NEWA thin wrapper around gnuplot for node.js
A thin wrapper around gnuplot for node.js
Have you seen a project which uses gnuplot's term library api (is there one) as an alternative to node-canvas and cairo? Say I want to write a new term and want to access it like canvas from vega-scenegraph to write to a PLY or STL 3d printer file? Thanks!
it would be nice to add the replot
command :)
if you add 'pause', then running from command line can open x11 windows.
in gnuplot.js
['set', 'unset', 'plot', 'splot', 'replot','pause'].forEach(function (name) {
thanks.
Is there any error handling in this? What happens when an instruction (string) given to gnuplot
creates and error and fails to produce a plot? I'm not seeing any obvious way to get feedback if something fails. Thanks!
Hi, I'm using gnuplot in order to create an image and send it in Telegram, the function it's like this:
function img_generation (result, callback) {
let plot = gnuplot()
.set('terminal png medium size 400,300')
.set('output "out.png"')
.set('title "Isotopic distribution"')
.unset('key') // no legend
.set('border 3')
.set('xlabel "m/z (Da)"')
.set('ylabel "Intensity (%)"')
.set('ytics nomirror') // hide ticks left
.set('xtics nomirror') // hide ticks top
.set('grid xtics lw 1 lc rgb "#dddddd"')
.set('grid ytics lw 1 lc rgb "#dddddd"')
.set('xrange [' + result.chartXFrom + ':' + result.chartXTo + ']')
.set('yrange [0:120]');
result.xy.forEach( (point) => {
plot.set('arrow from ' + point[0] + ',0 to ' + point[0] + ',' + point[1] * 100 + ' nohead lw 2 lc rgb "blue"');
});
plot.plot('sin(x) lc rgb "white"');
plot.end( (err) => {
if (err) console.error(err);
// here I send the image
bot.sendPhoto(fromId, 'out.png');
});
}
The problem is that the image it's trying to be sended before it's generated, do you have any idea why it's that happening?
Thanks, I love your module ๐
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.