{"id":15756873,"url":"https://github.com/mre/gnuplot","last_synced_at":"2025-03-31T08:25:44.355Z","repository":{"id":25170709,"uuid":"28593771","full_name":"mre/GnuPlot","owner":"mre","description":"A thin wrapper around GnuPlot ","archived":false,"fork":false,"pushed_at":"2014-12-29T13:52:23.000Z","size":128,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-06T12:48:19.478Z","etag":null,"topics":["cli","gnuplot","graph","graphics","label","php","wrapper"],"latest_commit_sha":null,"homepage":null,"language":"PHP","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/mre.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-12-29T13:51:53.000Z","updated_at":"2019-12-24T13:49:46.000Z","dependencies_parsed_at":"2022-08-06T03:16:28.710Z","dependency_job_id":null,"html_url":"https://github.com/mre/GnuPlot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mre%2FGnuPlot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mre%2FGnuPlot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mre%2FGnuPlot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mre%2FGnuPlot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mre","download_url":"https://codeload.github.com/mre/GnuPlot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246438326,"owners_count":20777403,"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":["cli","gnuplot","graph","graphics","label","php","wrapper"],"created_at":"2024-10-04T09:03:00.154Z","updated_at":"2025-03-31T08:25:44.323Z","avatar_url":"https://github.com/mre.png","language":"PHP","readme":"GnuPlot\n=======\n\nA PHP Library for using GnuPlot\n\nThis is the output of the `demo/write.php`:\n\n![gnuplot](demo/out.png)\n\nRequirements\n============\n\nYou need to have a server with `gnuplot` installed and the safe mode\ndisabled (to be able to run `proc_open()`)\n\nUsage\n=====\n\nThere is examples in the `demo/` directory.\n\nYou can create a graph and populate it like this:\n\n```php\n\u003c?php\n\nuse Gregwar\\GnuPlot\\GnuPlot;\n\n$plot = new GnuPlot;\n\n// Setting the main graph title\n$plot-\u003esetGraphTitle('Demo graph');\n\n// Adding three points to the first curve\n$plot\n    -\u003esetTitle(0, 'The first curve')\n    -\u003epush(0, 4)\n    -\u003epush(1, 5)\n    -\u003epush(2, 6)\n    ;\n\n// Adding three points on the other curve\n// (with index 1)\n$plot\n    -\u003esetTitle(1, 'The first curve')\n    -\u003epush(0, 8, 1)\n    -\u003epush(1, 9, 1)\n    -\u003epush(2, 10, 2)\n    ;\n```\n\nYou can then save it to a file, have a look to `write.php` for example:\n\n```php\n\u003c?php\n\n// Write the graph to out.png\n$plot-\u003ewritePng('out.png');\n```\n\nOr render it directly into a browser, you can try `out.php` for\nexample:\n\n```php\n\u003c?php\n\nheader('Content-type: image/png');\necho $plot-\u003eget();\n```\n\nOr display it on the screen (useful with CLI scripts), run the \n`demo.php` script for example:\n\n```php\n\u003c?php\n\n$plot-\u003edisplay();\n```\n\nOr display it, and re-feed it in real time (with CLI scripts), you can\nrun `realTime.php` for example:\n\n```php\n\u003c?php\n\n$plot-\u003erefresh();\n```\n\nAPI\n===\n\n* `push($x, $y, $index=0)`, add a point to the $index-nth curve\n* `display()`, renders the graph on the screen (asuming you are using\n  it as a CLI with an X Server\n* `refresh()`, same as `display()`, but will replot the graph after\n  the first call\n* `get()`, gets the PNG data for your image\n* `writePng($filename)`, write the data to the output file\n* `setTitle($index, $title)`, sets the title of the $index-nt curve\n* `setGraphTitle($title)`, sets the main title for the graph\n* `setXLabel($text)`, sets the label for the X axis\n* `setYLabel($text)`, sets the label for the Y axis\n* `setXRange($min, $max)`, set the X min \u0026 max \n* `setYRange($min, $max)`, set the Y min \u0026 max \n* `setWidth($width)`, sets the width of the graph\n* `setHeight($height)`, sets the width of the graph\n* `addLabel($x, $y, $text)`, add some label at a point\n\nLicense\n=======\n\n`Gregwar\\GnuPlot` is under MIT license\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmre%2Fgnuplot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmre%2Fgnuplot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmre%2Fgnuplot/lists"}