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>SetPlotAreaPixels</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="SetPlotAreaBgImage.html" title="SetPlotAreaBgImage" /><link rel="next" href="SetPlotAreaWorld.html" title="SetPlotAreaWorld" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">SetPlotAreaPixels</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="SetPlotAreaBgImage.html">Prev</a> </td><th width="60%" align="center">PHPlot Function Reference</th><td width="20%" align="right"> <a accesskey="n" href="SetPlotAreaWorld.html">Next</a></td></tr></table><hr /></div><div class="refentry"><a id="SetPlotAreaPixels"></a><div class="titlepage"></div><div class="refnamediv"><h2><span class="refentrytitle">SetPlotAreaPixels</span></h2><p>SetPlotAreaPixels — Set the limits for the plot area in device coordinates</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">$plot->SetPlotAreaPixels([<span class="optional"><em class="parameter"><code>$x1</code></em></span>], [<span class="optional"><em class="parameter"><code>$y1</code></em></span>], [<span class="optional"><em class="parameter"><code>$x2</code></em></span>], [<span class="optional"><em class="parameter"><code>$y2</code></em></span>])</pre></div><div class="refsect1"><a id="idp1378561276"></a><h2>Description</h2><p>
|
|
|
3 |
<code class="function">SetPlotAreaPixels</code> sets the area to be used for the plot
|
|
|
4 |
within the image, in device coordinates.
|
|
|
5 |
(Device coordinates are GD coordinates, with the origin at the top left
|
|
|
6 |
of the image, X values increase to the right, Y values increase down,
|
|
|
7 |
and the units in pixels.)
|
|
|
8 |
The plot area is equal to the image area minus the margins. By default, the
|
|
|
9 |
margins (and therefore the plot area) are automatically calculated based on
|
|
|
10 |
the space needed for titles, labels, etc.
|
|
|
11 |
Use SetPlotAreaPixels to override these automatic calculations and
|
|
|
12 |
control the plot area.
|
|
|
13 |
The four coordinate values are specified independently.
|
|
|
14 |
SetPlotAreaPixels and <a class="xref" href="SetMarginsPixels.html" title="SetMarginsPixels"><span class="refentrytitle">SetMarginsPixels</span></a> perform the same
|
|
|
15 |
function with different semantics.
|
|
|
16 |
</p></div><div class="refsect1"><a id="idp1378563260"></a><h2>Parameters</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="replaceable"><code>$x1</code></em>, </span><span class="term"><em class="replaceable"><code>$y1</code></em></span></dt><dd><p>
|
|
|
17 |
Device coordinates of the top left corner of the area to use for the plot.
|
|
|
18 |
Each value is optional, and if omitted or NULL the automatically calculated
|
|
|
19 |
value is used.
|
|
|
20 |
</p></dd><dt><span class="term"><em class="replaceable"><code>$x2</code></em>, </span><span class="term"><em class="replaceable"><code>$y2</code></em></span></dt><dd><p>
|
|
|
21 |
Device coordinates of the bottom right corner of the area to use for the plot.
|
|
|
22 |
Each value is optional, and if omitted or NULL the automatically calculated
|
|
|
23 |
value is used.
|
|
|
24 |
</p></dd></dl></div></div><div class="refsect1"><a id="idp1378566404"></a><h2>Notes</h2><p>
|
|
|
25 |
The plot area is equal to the image area minus the margins. By default, the
|
|
|
26 |
margins (and therefore the plot area) are automatically calculated based on
|
|
|
27 |
the space needed for items <span class="emphasis"><em>outside</em></span> the plot area. The
|
|
|
28 |
plot area is then whatever space remains. Calculation for most plot types
|
|
|
29 |
takes into account the main title, axis titles, tick or data labels, and tick
|
|
|
30 |
marks (but not the legend, if drawn). For pie charts, only the main title
|
|
|
31 |
size is used when calculating the needed margins.
|
|
|
32 |
Use SetPlotAreaPixels to override these automatic calculations and
|
|
|
33 |
control the plot area.
|
|
|
34 |
</p><p>
|
|
|
35 |
SetPlotAreaPixels and <a class="xref" href="SetMarginsPixels.html" title="SetMarginsPixels"><span class="refentrytitle">SetMarginsPixels</span></a> perform the same
|
|
|
36 |
function with different semantics. It makes no sense to use both - only the
|
|
|
37 |
last one called will have an effect.
|
|
|
38 |
</p><p>
|
|
|
39 |
SetPlotAreaPixels is also used when placing multiple plots on an image.
|
|
|
40 |
See <a class="xref" href="adv-multiplot.html" title="4.8. Multiple Plots Per Image">Section 4.8, “Multiple Plots Per Image”</a> for more information.
|
|
|
41 |
</p><p>
|
|
|
42 |
Trailing defaulted arguments can be omitted, but non-trailing defaulted
|
|
|
43 |
arguments must be specified as NULL. For example, to fix the bottom right
|
|
|
44 |
corner of the plot area at (600, 400) and let PHPlot calculate the upper
|
|
|
45 |
left corner use:
|
|
|
46 |
</p><pre class="programlisting">$plot->SetPlotAreaPixels(NULL, NULL, 600, 400);
|
|
|
47 |
</pre><p>
|
|
|
48 |
You do not have to specify both X and Y. The following example sets the right
|
|
|
49 |
edge of the plot area at X=600 and lets the other 3 edges be automatically
|
|
|
50 |
calculated:
|
|
|
51 |
</p><pre class="programlisting">$plot->SetPlotAreaPixels(NULL, NULL, 600);
|
|
|
52 |
</pre><p>
|
|
|
53 |
</p></div><div class="refsect1"><a id="idp1378570580"></a><h2>History</h2><p>
|
|
|
54 |
Through PHPlot-5.0.6, SetPlotAreaPixels required all 4 arguments be
|
|
|
55 |
specified and not be NULL. Starting with PHPlot-5.0.7, each X and Y
|
|
|
56 |
parameter can either be specified or automatically calculated.
|
|
|
57 |
</p><p>
|
|
|
58 |
SetPlotAreaPixels and SetPlotAreaWorld can be called in either order.
|
|
|
59 |
Through PHPlot-5.0.4 this was because SetPlotAreaPixels would
|
|
|
60 |
reset the scale factors if <a class="xref" href="SetPlotAreaWorld.html" title="SetPlotAreaWorld"><span class="refentrytitle">SetPlotAreaWorld</span></a> was already
|
|
|
61 |
called.
|
|
|
62 |
Starting with PHPlot-5.0.5, both functions just store the information,
|
|
|
63 |
and no calculations take place until <a class="xref" href="DrawGraph.html" title="DrawGraph"><span class="refentrytitle">DrawGraph</span></a> is used.
|
|
|
64 |
</p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="SetPlotAreaBgImage.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="SetPlotAreaWorld.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">SetPlotAreaBgImage </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> SetPlotAreaWorld</td></tr></table></div></body></html>
|