Display Matplotlib.pyplot graph in php

Simon Leung
Simon Leung used Ask the Experts™
on
Any idea how to display the pyplot graph in php code ? Any example or reference on this ?

Thx
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
nociSoftware Engineer
Distinguished Expert 2018

Commented:
pyplot is a python library.. Why not use a php library for PHP?  it is named PHPlot: http://phplot.org/

Author

Commented:
as I want the machine learning result from Python to display in PHP
Software Engineer
Distinguished Expert 2018
Commented:
Is django maybe a better fit for presenting result?
or some other python based CMS? ( https://www.slant.co/topics/1778/~best-python-based-cmss )

PHP will not call Python methods in any way or form.
you you may be able to run python in some exec...

$result = system("python the_python_script.py");
print $result;

Open in new window

Where the python script produces all needed HTML and files etc.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial