Download the PHP package abbadon1334/gnuplot without Composer
On this page you can find all versions of the php package abbadon1334/gnuplot. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download abbadon1334/gnuplot
More information about abbadon1334/gnuplot
Files in abbadon1334/gnuplot
Package gnuplot
Short Description GnuPlot library
License MIT
Homepage https://github.com/Gregwar/GnuPlot
Informations about the package gnuplot
GnuPlot
A PHP Library for using GnuPlot
This is the output of the demo/write.php
:
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:
You can then save it to a file, have a look to write.php
for example:
Or render it directly into a browser, you can try out.php
for
example:
Or display it on the screen (useful with CLI scripts), run the
demo.php
script for example:
Or display it, and re-feed it in real time (with CLI scripts), you can
run realTime.php
for example:
API
push($x, $y, $index=0)
, add a point to the $index-nth curve ($y can be an array if the linemode isGnuPlot::LINEMODE_FILLEDCURVES
)display()
, renders the graph on the screen (asuming you are using it as a CLI with an X Serverrefresh()
, same asdisplay()
, but will replot the graph after the first callget()
, gets the PNG data for your imagewritePng($filename)
, writes the data to the output PNG filewritePDF($filename)
, writes the data to the output PDF filewriteEPS($filename)
, writes the data to the output EPS filesetTitle($index, $title)
, sets the title of the $index-nt curvesetLineWidth($index, $width)
, sets the width of the $index-nt curvesetLineMode($index, $mode)
, sets the line mode of the $index-nt curve (set toGnuPlot::LINEMODE_FILLEDCURVES
to fill an area between two lines)setLinePoint($index, $point)
, sets the line point of the $index-nt curvesetLineType($index, $type)
, sets the line type of the $index-nt curvesetLineColor($index, $color)
, sets the line color of the $index-nt curvesetLineSmooth($index, $smooth)
, sets the smooth type of the $index-nt curve. Available smooths areSMOOTH_NONE
,SMOOTH_BEZIER
,SMOOTH_CSPLINE
, defined as constants on theGnuPlot
class.setGraphTitle($title)
, sets the main title for the graphsetXTimeFormat($format)
, sets the X axis as a time axis and specify data formatsetTimeFormatString($format)
, specify the X axis time presentation formatsetXLabel($text)
, sets the label for the X axissetYLabel($text)
, sets the label for the Y axissetYFormat($format)
, sets Y axis formattingsetXRange($min, $max)
, set the X min & maxsetYRange($min, $max)
, set the Y min & maxsetXTics($tics)
, set the X ticssetYTics($tics)
, set the Y ticssetMXTics($tics)
, set the micro X ticssetMYTics($tics)
, set the micro Y ticssetMinorGrid($status)
, enabled/disables the grid for microticssetGridPlacement($layer)
, sets the placement of the grid, can beGnuPlot::GRID_DEFAULT
,GnuPlot::GRID_FRONT
orGnuPlot::GRID_BACK
setWidth($width)
, sets the width of the graphsetHeight($height)
, sets the height of the graphsetCanvasWidth($width)
, sets the width of the canvas (if not set, the width value is used)setCanvasHeight($height)
, sets the height of the canvas (if not set, the height value is used)setOrigin($x, $y)
, sets the origin of the graphsetSleepTime($sleepTime)
, sets the sleep time after saving a fileaddLabel($x, $y, $text)
, add some label at a pointflush()
, completely flushes the internal state and resets the object to its initial state
License
Gregwar\GnuPlot
is under MIT license