Recommend this page to a friend! |
Classes of Rafael Martin Soto | PHP Plot Graph | README.md | Download |
|
Downloadphp-libplot. Written in PHP. Graphs charts, scatter, plot, lines, custom graphsMatplotlib. Pyplot written in PHP. Graphs charts, scatter, plot, lines, custom graphs V.1.0.0This class starts with the need to create graphics in the style of MatLibPlot, but in pure PHP language due to the use on shared servers with access restrictions to the system to install third-party applications. This first version performs a great variety of the best pyplot functions, combined with mathematical numpy functions commonly used in Machine Learning as linspace or arraypow. It is based on the same functions already prepared intentionally with a regular use of MatibPlot and also written in PHP https://github.com/vivesweb/graph-php. That is why it is recommended to also read the documentation of this second class, where most of the methods used by PHP-LibPlot are original provided. SAMPLES:Sample of Pairplot(): Other Samples that you can generate with php-libplot and provided by inside php-graph class: REQUERIMENTS:
# SERVER REQUERIMENTS:
# What if I don't have Imagick installed?: If you do not have Imagick installed and perform some filter that use imagick, the system just won't apply that filter. # FILES: There are 2 basic files: php-libplot.class.php -> Master class. This file is the main file that you need to include in your code. example.php -> example file # NOTE: In this earlier version, for see the graph, you need to call output_gd_png_base64( ) and draw directly in <img> html object. See example file. # INSTALLATION: A lot of easy :smiley:. It is written in PURE PHP. Only need to include the files. Tested on basic PHP installation
# BASIC USAGE:
RESUME OF METHODS:
$tpl= new php_plotlib( );
You can create subplots inside a plot and manage they individually. subplots( $numyplots = null, $numxplots = null, $cfg = [ 'bordertype' => 'square', 'figsize' => [6.4, 4.8], 'paddingleft' => .2, 'paddingbottom' => .15 ]) $numyplots: Number of vertical subplots $numxplots: Number of horizontal subplots $cfg: Configuration of subplots: - bordertype: ['square' | 'halfsquare'] - figsize: size in inches (width, height), in inches - paddingleft: If you need space at left, you can to set here in inches - paddingbottom: If you need space at left, you can to set here in inches Example:
You can create a pairplot graph from csv dataset in array. First row need to be col names. In $cfg array you can set the width of the markers: ['widthmarker' => 5] pairplot( $dataset, $cfg = null ) example:
} fclose($gestor);
IMPORTANT NOTE!!! For other methods read https://github.com/vivesweb/graph-php documentation. Example.php file of php-libplot class uses some of the php-graph methods directly (plot, bar, title, ...) as example of use: - bar() - plot() - title() - xlabel() - ylabel() - axes() - legend() - set_drawguidelines() - set_x_drawguidelines(9 - set_y_drawguidelines() - legendwidthlines() - legendlabelheight() - imread() - xticks() - scatter() - hist() - width() - height() - And a common math python funcions created in php as linspace, arraypow and others
Of course. You can use it freely :vulcan_salute::alien: By Rafa. @author Rafael Martin Soto @author {@link http://www.inatica.com/ Inatica} @blog {@link https://rafamartin10.blogspot.com/ Rafael Martin's Blog} @since OCTOBER 2021 @version 1.0.3 @license GNU General Public License v3.0 |