{"id":22138887,"url":"https://github.com/stoqey/gnuplot","last_synced_at":"2025-07-17T23:39:14.729Z","repository":{"id":42884551,"uuid":"255502995","full_name":"stoqey/gnuplot","owner":"stoqey","description":"Node gnuplot","archived":false,"fork":false,"pushed_at":"2022-03-26T12:36:15.000Z","size":251,"stargazers_count":1,"open_issues_count":6,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-09T13:45:10.257Z","etag":null,"topics":["axis","gnuplot","gnuplot-interface","graph","label","series"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stoqey.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":null,"patreon":null,"open_collective":"vuga","ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2020-04-14T03:41:15.000Z","updated_at":"2021-03-14T14:15:21.000Z","dependencies_parsed_at":"2022-09-03T07:40:08.562Z","dependency_job_id":null,"html_url":"https://github.com/stoqey/gnuplot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/stoqey/gnuplot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stoqey%2Fgnuplot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stoqey%2Fgnuplot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stoqey%2Fgnuplot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stoqey%2Fgnuplot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stoqey","download_url":"https://codeload.github.com/stoqey/gnuplot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stoqey%2Fgnuplot/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265679246,"owners_count":23810121,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["axis","gnuplot","gnuplot-interface","graph","label","series"],"created_at":"2024-12-01T20:12:14.779Z","updated_at":"2025-07-17T23:39:14.709Z","avatar_url":"https://github.com/stoqey.png","language":"TypeScript","readme":"# **gnuplot** for node\n\n[![npm](https://img.shields.io/npm/dt/@stoqey/gnuplot.svg)](http://www.npmtrends.com/@stoqey/gnuplot)\n![TypeScript compatible](https://img.shields.io/badge/typescript-compatible-brightgreen.svg)\n\n**@stoqey/gnuplot** is an easy to use node  module to draw charts using [gnuplot](http://www.gnuplot.info/) and [ps2pdf](http://pages.cs.wisc.edu/~ghost/doc/AFPL/6.50/Ps2pdf.htm). This module is based on Richard Meadows's [node-plotter](https://github.com/richardeoin/nodejs-plotter)\n\n## Installation ##\n\nPrerequisites:\n\n\n```bash\n# ubuntu\nsudo apt-get install gnuplot\n\n# alpine\napk add gnuplot\n\n# mac\nbrew install gnuplot\n\n```\n\nTo install package, just run:\n\n```\nnpm install @stoqey/gnuplot\n```\n\n## Usage ##\n\n```javascript\nimport plot from '@stoqey/gnuplot'\n\n// with callback\nplot({\n\tdata:\t\t[ 3, 1, 2, 3, 4 ],\n\tfilename:\t'output.png',\n\tfinish: (error) =\u003e {\n\n\t}\n});\n\n// As promise\nconst plotted = await plot({\n\tdata: [3, 1, 2, 3, 4],\n\tfilename: 'output1.png',\n});\n```\n\n### Output format ###\n\nThis defaults to `.png` but specifing `format: svg` changes the output\nto [.svg](http://www.w3.org/Graphics/SVG/) and `format: pdf` changes\nthe output format to\n[.pdf](http://en.wikipedia.org/wiki/Portable_Document_Format).\n\n```javascript\nimport plot from '@stoqey/gnuplot'\n\nplot({\n\tdata:\t\t[ 3, 1, 2, 3, 4 ],\n\tfilename:\t'output.svg',\n\tformat:\t\t'svg'\n});\n```\n\n### Formatting ###\n\nThe following properties can be used:\n- `title` : _Sets the title of the graph_\n- `xlabel` : _Sets the label on the x axis of the graph_\n- `ylabel` : _Sets the label on the y axis of the graph_\n- `logscale` : _Makes the y axis of the graph appear in a log scale_\n- `style` : _The style of the lines on the graph. Possibilites include\n  `lines` (default), `points` and `linespoints`_\n- `nokey` : _Disables the graph key_\n- `hideSeriesTitle`: _Indicates if plot should include legend_\n- `margin`: _Sets margin if needed_\n- `xRange`: _Sets max and min values for the X axis_\n- `yRange`: _Sets max and min values for the Y axis_\n- `decimalsign`: _Specifies a custom decimal sign_\n- `yFormat`: _Specifies how to format values on the Y axis_\n- `font`: _Specify a custom font_\n- `fontSize`: _Font size_\n- `titleSize`: _Title font size_\n- `width`: _Plot width_\n- `height`: _Plot height_\n- `locale`: _Locale code (run 'set locale' for the exact value)_\n\nThe following example shows these in use:\n\n```javascript\nplot({\n\ttitle:\t\t'example',\n\tdata:\t\t{ 't1' : { 1357162672: 22.2, 1357162782: 23, 1357162892: 24 } },\n\ttime:\t\t'hours',\n\tstyle:\t\t'line',\n\tfilename:\t'test/output14.png',\n\tformat:\t\t'png',\n\tdecimalsign: ',',\n\tyFormat: '%.2f USD',\n\thideSeriesTitle: true,\n\txlabel:\t\t'Time',\n\tylabel:\t\t'Price',\n\tmargin: \t{\n\t\tleft: 10,\n\t\tright: 3,\n\t\ttop: 3,\n\t\tbottom: 4\n\t},\n\txRotate: {\n\t\tvalue: 45,\n\t\tyOffset: -1.5,\n\t\txOffset: -2\n\t},\n\thideSeriesTitle: true,\n\txRange: {\n\t\tmin: 0,\n\t\tmax: 100\n\t}\n});\n```\n\n### Specifing X and Y values ###\n\n```javascript\nplot({\n\tdata:\t\t{ 'line' : { 1: 5, 5: 6 } },\n\tfilename:\t'output.png'\n});\n```\n\nInstead of specifing an array for `data`, you can specify an object\nwith a named series inside.\n\n### Multiple Series ###\n\n```javascript\nplot({\n\tdata:\t\t{ 'tick' : [ 3, 1, 2, 3, 4 ], 'line' : { 1: 5, 5: 6 } },\n\tfilename:\t'output.png'\n});\n```\n\n### Time Formatting ###\n\n```javascript\nplot({\n\tdata:\t\t{ 'temperature' :\n\t\t\t{ 1357162672: 22, 1357162782: 23, 1357162892: 24 } },\n\ttime:\t\t'hours',\n\tfilename:\t'output.png'\n});\n```\n\nThe x axis can be formatted as a time series if the x values are given\nas a [unix time](http://en.wikipedia.org/wiki/Unix_time). The `time`\nproperty can be specified with the [gnuplot time format](http://gnuplot.sourceforge.net/docs_4.2/node274.html).\n\n### Other options ###\n\nThe options object might additionally contain the following:\n\nOption | Description | Example\n-------|-------------|---------\n`exec`   | Arguments for the gnuplot process | `options.exec = { cwd : '/home/user/images' };`\n`finish` | Callback executed when the gnuplot process finishes | `options.finish = function(){ Console.log('Success!'); };`\n","funding_links":["https://opencollective.com/vuga"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstoqey%2Fgnuplot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstoqey%2Fgnuplot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstoqey%2Fgnuplot/lists"}