Subversion Repositories cheapmusic

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
98 - 1
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
2
<!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 &#8212; 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>
3
This is the class constructor for PHPlot. It creates a new plot object and
4
initializes all internal settings to default values.
5
    </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>
6
Optional width of the plot image, in pixels. Default is 600.
7
          </p></dd><dt><span class="term"><em class="replaceable"><code>$height</code></em></span></dt><dd><p>
8
Optional height of the plot image, in pixels. Default is 400.
9
          </p></dd><dt><span class="term"><em class="replaceable"><code>$output_file</code></em></span></dt><dd><p>
10
Optional name of a file where the image output will be written.
11
This is the same as using <a class="xref" href="SetOutputFile.html" title="SetOutputFile"><span class="refentrytitle">SetOutputFile</span></a>.
12
Default is no output file, meaning the image is written to standard output
13
(that is, sent back to the browser).
14
          </p></dd><dt><span class="term"><em class="replaceable"><code>$input_file</code></em></span></dt><dd><p>
15
Optional name of a file to use as a starting image. This becomes the
16
background for the plot.  If an input_file is given, any width and height
17
given to the constructor are ignored, and the size of the image in the
18
named input_file are the plot image size.  Default is no input file,
19
meaning a blank image will be created at the given or default width and
20
height.
21
          </p></dd></dl></div></div><div class="refsect1"><a id="idp1377749012"></a><h2>Return Value</h2><p>
22
Returns an object, an instance of the PHPlot class.
23
    </p></div><div class="refsect1"><a id="idp1377749652"></a><h2>Notes</h2><p>
24
The output_file will be ignored unless <a class="xref" href="SetIsInline.html" title="SetIsInline"><span class="refentrytitle">SetIsInline</span></a>(True) is
25
called.
26
    </p><p>
27
If no input_file is supplied, the PHPlot constructor creates
28
a <a class="link" href="concepts.html#def-palette">palette</a> plot image,
29
and the <a class="xref" href="PHPlot-truecolor.html" title="PHPlot_truecolor"><span class="refentrytitle">PHPlot_truecolor</span></a> constructor creates
30
a <a class="link" href="concepts.html#def-truecolor">truecolor</a> plot image.
31
If an input_file is supplied, the two constructors are equivalent, and the
32
type of the input file (truecolor or palette) determines the type of the
33
plot image.
34
    </p></div><div class="refsect1"><a id="idp1377752332"></a><h2>History</h2><p>
35
Earlier versions of this manual said that the created object should always
36
be returned as a reference, like this:
37
      </p><pre class="programlisting">$plot =&amp; new PHPlot(...);  // Do not use this
38
</pre><p>
39
This was because PHPlot included a function to deallocate memory used by
40
the object at script shutdown, but that would only work if a reference
41
assignment was used. This quasi-destructor was removed at PHPlot-5.0.4
42
because it interfered with memory deallocation until the script ended.
43
So the reference assignment should not be used.
44
In addition, reference assignment of a newly created object instance
45
is deprecated starting with PHP5, and removed in PHP7.
46
    </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>