All Projects → Gregwar → GnuPlot

Gregwar / GnuPlot

Licence: MIT license
A PHP Library for using GnuPlot

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to GnuPlot

Aachartkit Swift
📈📊📱💻🖥️An elegant modern declarative data visualization chart framework for iOS, iPadOS and macOS. Extremely powerful, supports line, spline, area, areaspline, column, bar, pie, scatter, angular gauges, arearange, areasplinerange, columnrange, bubble, box plot, error bars, funnel, waterfall and polar chart types. 极其精美而又强大的跨平台数据可视化图表框架,支持柱状图、条形图、…
Stars: ✭ 1,962 (+7446.15%)
Mutual labels:  plot, draw
pgfplots
pgfplots - A TeX package to draw normal and/or logarithmic plots directly in TeX in two and three dimensions with a user-friendly interface and pgfplotstable - a TeX package to round and format numerical tables. Examples in manuals and/or on web site.
Stars: ✭ 119 (+357.69%)
Mutual labels:  plot, draw
Cetus
Full-featured user interface for Machinekit
Stars: ✭ 33 (+26.92%)
Mutual labels:  axis
JPlotter
OpenGL based 2D Plotting Library for Java using AWT and LWJGL
Stars: ✭ 36 (+38.46%)
Mutual labels:  plot
ploot
Plot streaming data from stdin to a tty terminal
Stars: ✭ 54 (+107.69%)
Mutual labels:  plot
nets
Draw your net
Stars: ✭ 49 (+88.46%)
Mutual labels:  draw
go-notebook
Go-Notebook is inspired by Jupyter Project (link) in order to document Golang code.
Stars: ✭ 33 (+26.92%)
Mutual labels:  plot
release-changelog-builder-action
A GitHub action that builds your release notes / changelog fast, easy and exactly the way you want.
Stars: ✭ 515 (+1880.77%)
Mutual labels:  labels
drawim
A simple drawing library in Nim, inspired by p5js
Stars: ✭ 66 (+153.85%)
Mutual labels:  draw
u-draw-poster
绘制多端海报工具,支持uni多端与微信环境执行。
Stars: ✭ 41 (+57.69%)
Mutual labels:  draw
DRAW
DRAW: The Dart Reddit API Wrapper
Stars: ✭ 82 (+215.38%)
Mutual labels:  draw
clusterix
Visual exploration of clustered data.
Stars: ✭ 44 (+69.23%)
Mutual labels:  plot
multigraph
multigraph: Plot and Manipulate Multigraphs in R
Stars: ✭ 18 (-30.77%)
Mutual labels:  plot
Leaflet.streetlabels
Display the street labels following polylines for Leaflet
Stars: ✭ 58 (+123.08%)
Mutual labels:  labels
sarviewer
Generate graphs with gnuplot or matplotlib (Python) from sar data
Stars: ✭ 60 (+130.77%)
Mutual labels:  plot
MPU-9250-Sensors-Data-Collect
MPU9250 (MPU6500 + AK8963) I2C Driver in Python for Raspbery PI
Stars: ✭ 51 (+96.15%)
Mutual labels:  axis
charter
DSL and C Library to generate SVG Plot
Stars: ✭ 39 (+50%)
Mutual labels:  plot
mpvue canvas drawer
[mpvue版本]微信小程序上canvas绘制图片助手,一个json就制作分享朋友圈图片
Stars: ✭ 43 (+65.38%)
Mutual labels:  draw
gantt-chart
Web component implementation of a Gantt chart.
Stars: ✭ 24 (-7.69%)
Mutual labels:  plot
android-3d-model-viewer
Android app to load 3D models in obj, stl, dae & gltf format using pure OpenGL ES 2.0. Published on Play Store https://play.google.com/store/apps/details?id=org.andresoviedo.dddmodel2
Stars: ✭ 150 (+476.92%)
Mutual labels:  draw

GnuPlot

A PHP Library for using GnuPlot

WARNING: This invoke the gnuplot command line as back-end, which can lead to arbitrary code execution. Be careful if you intend to use this library with user-provided information. Have a look at this post for more information.

This is the output of the demo/write.php:

gnuplot

Requirements

You need to have a server with gnuplot installed and the safe mode disabled (to be able to run proc_open())

Usage

There is examples in the demo/ directory.

You can create a graph and populate it like this:

<?php

use Gregwar\GnuPlot\GnuPlot;

$plot = new GnuPlot;

// Setting the main graph title
$plot->setGraphTitle('Demo graph');

// Adding three points to the first curve
$plot
    ->setTitle(0, 'The first curve')
    ->push(0, 4)
    ->push(1, 5)
    ->push(2, 6)
    ;

// Adding three points on the other curve
// (with index 1)
$plot
    ->setTitle(1, 'The first curve')
    ->push(0, 8, 1)
    ->push(1, 9, 1)
    ->push(2, 10, 2)
    ;

You can then save it to a file, have a look to write.php for example:

<?php

// Write the graph to out.png
$plot->writePng('out.png');

Or render it directly into a browser, you can try out.php for example:

<?php

header('Content-type: image/png');
echo $plot->get();

Or display it on the screen (useful with CLI scripts), run the demo.php script for example:

<?php

$plot->display();

Or display it, and re-feed it in real time (with CLI scripts), you can run realTime.php for example:

<?php

$plot->refresh();

API

  • push($x, $y, $index=0), add a point to the $index-nth curve
  • display(), renders the graph on the screen (asuming you are using it as a CLI with an X Server
  • refresh(), same as display(), but will replot the graph after the first call
  • get(), gets the PNG data for your image
  • writePng($filename), write the data to the output file
  • setTitle($index, $title), sets the title of the $index-nt curve
  • setGraphTitle($title), sets the main title for the graph
  • setXTimeFormat($format), sets the X axis as a time axis and specify data format
  • setXTimeFormatString($format), specify the X axis time presentation format
  • setXLabel($text), sets the label for the X axis
  • setYLabel($text), sets the label for the Y axis
  • setYFormat($format), sets Y axis formatting
  • setXRange($min, $max), set the X min & max
  • setYRange($min, $max), set the Y min & max
  • setWidth($width), sets the width of the graph
  • setHeight($height), sets the width of the graph
  • addLabel($x, $y, $text), add some label at a point

License

Gregwar\GnuPlot is under MIT license

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].