Blame | Last modification | View Log | RSS feed
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><title>PHPlot</title><link rel="stylesheet" type="text/css" href="phplotdoc.css" /><meta name="generator" content="DocBook XSL Stylesheets V1.78.1" /><link rel="home" href="index.html" title="PHPlot Reference Manual" /><link rel="up" href="reference.html" title="PHPlot Function Reference" /><link rel="prev" href="GetLegendSize.html" title="GetLegendSize" /><link rel="next" href="PHPlot-truecolor.html" title="PHPlot_truecolor" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">PHPlot</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="GetLegendSize.html">Prev</a> </td><th width="60%" align="center">PHPlot Function Reference</th><td width="20%" align="right"> <a accesskey="n" href="PHPlot-
truecolor.html">Next</a></td></tr></table><hr /></div><div class="refentry"><a id="PHPlot"></a><div class="titlepage"></div><div class="refnamediv"><h2><span class="refentrytitle">PHPlot</span></h2><p>PHPlot — Construct a new PHPlot Class Object</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">$plot = new PHPlot([<span class="optional"><em class="parameter"><code>$width</code></em></span>], [<span class="optional"><em class="parameter"><code>$height</code></em></span>], [<span class="optional"><em class="parameter"><code>$output_file</code></em></span>], [<span class="optional"><em class="parameter"><code>$input_file</code></em></span>])</pre></div><div class="refsect1"><a id="idp1377743148"></a><h2>Description</h2><p>
This is the class constructor for PHPlot. It creates a new plot object and
initializes all internal settings to default values.
</p></div><div class="refsect1"><a id="idp1377743884"></a><h2>Parameters</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="replaceable"><code>$width</code></em></span></dt><dd><p>
Optional width of the plot image, in pixels. Default is 600.
</p></dd><dt><span class="term"><em class="replaceable"><code>$height</code></em></span></dt><dd><p>
Optional height of the plot image, in pixels. Default is 400.
</p></dd><dt><span class="term"><em class="replaceable"><code>$output_file</code></em></span></dt><dd><p>
Optional name of a file where the image output will be written.
This is the same as using <a class="xref" href="SetOutputFile.html" title="SetOutputFile"><span class="refentrytitle">SetOutputFile</span></a>.
Default is no output file, meaning the image is written to standard output
(that is, sent back to the browser).
</p></dd><dt><span class="term"><em class="replaceable"><code>$input_file</code></em></span></dt><dd><p>
Optional name of a file to use as a starting image. This becomes the
background for the plot. If an input_file is given, any width and height
given to the constructor are ignored, and the size of the image in the
named input_file are the plot image size. Default is no input file,
meaning a blank image will be created at the given or default width and
height.
</p></dd></dl></div></div><div class="refsect1"><a id="idp1377749012"></a><h2>Return Value</h2><p>
Returns an object, an instance of the PHPlot class.
</p></div><div class="refsect1"><a id="idp1377749652"></a><h2>Notes</h2><p>
The output_file will be ignored unless <a class="xref" href="SetIsInline.html" title="SetIsInline"><span class="refentrytitle">SetIsInline</span></a>(True) is
called.
</p><p>
If no input_file is supplied, the PHPlot constructor creates
a <a class="link" href="concepts.html#def-palette">palette</a> plot image,
and the <a class="xref" href="PHPlot-truecolor.html" title="PHPlot_truecolor"><span class="refentrytitle">PHPlot_truecolor</span></a> constructor creates
a <a class="link" href="concepts.html#def-truecolor">truecolor</a> plot image.
If an input_file is supplied, the two constructors are equivalent, and the
type of the input file (truecolor or palette) determines the type of the
plot image.
</p></div><div class="refsect1"><a id="idp1377752332"></a><h2>History</h2><p>
Earlier versions of this manual said that the created object should always
be returned as a reference, like this:
</p><pre class="programlisting">$plot =& new PHPlot(...); // Do not use this
</pre><p>
This was because PHPlot included a function to deallocate memory used by
the object at script shutdown, but that would only work if a reference
assignment was used. This quasi-destructor was removed at PHPlot-5.0.4
because it interfered with memory deallocation until the script ended.
So the reference assignment should not be used.
In addition, reference assignment of a newly created object instance
is deprecated starting with PHP5, and removed in PHP7.
</p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="GetLegendSize.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="reference.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="PHPlot-truecolor.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">GetLegendSize </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> PHPlot_truecolor</td></tr></table></div></body></html>