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>SetPlotAreaWorld</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="SetPlotAreaPixels.html" title="SetPlotAreaPixels" /><link rel="next" href="SetPlotBgColor.html" title="SetPlotBgColor" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">SetPlotAreaWorld</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="SetPlotAreaPixels.html">Prev</a> </td><th width="60%" align="center">PHPlot Function Reference</th><td width="20%" align="right"> <aaccesskey="n" href="SetPlotBgColor.html">Next</a></td></tr></table><hr /></div><div class="refentry"><a id="SetPlotAreaWorld"></a><div class="titlepage"></div><div class="refnamediv"><h2><span class="refentrytitle">SetPlotAreaWorld</span></h2><p>SetPlotAreaWorld — Override automatic data scaling to device coordinates</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">$plot->SetPlotAreaWorld([<span class="optional"><em class="parameter"><code>$xmin</code></em></span>], [<span class="optional"><em class="parameter"><code>$ymin</code></em></span>], [<span class="optional"><em class="parameter"><code>$xmax</code></em></span>], [<span class="optional"><em class="parameter"><code>$ymax</code></em></span>])</pre></div><div class="refsect1"><a id="idp1378576204"></a><h2>Description</h2><p><code class="function">SetPlotAreaWorld</code> changes the range for World Coordinatespace. This is the coordinate space of the data to be plotted, and istranslated and scaled to fit into the Device Coordinate space of the image.By default, PHPlot defines the world coordinate space based on the actual limitsof the data to be plotted. By using SetPlotAreaWorld, you can override one ormore of the calculated limits. Each parameter you specify overridesthe corresponding calculated limit. Each defaulted or NULL parameter isignored and the calculated limit is used.</p></div><div class="refsect1"><a id="idp1378577684"></a><h2>Parameters</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="replaceable"><code>$xmin</code></em></span></dt><dd><p>Optional argument specifying the desired X data range minimum value.If omitted or NULL, the value is calculated from the actual plot data.</p></dd><dt><span class="term"><em class="replaceable"><code>$ymin</code></em></span></dt><dd><p>Optional argument specifying the desired Y data range minimum value.If omitted or NULL, the value is calculated from the actual plot data.</p></dd><dt><span class="term"><em class="replaceable"><code>$xmax</code></em></span></dt><dd><p>Optional argument specifying the desired X data range maximum value.If omitted or NULL, the value is calculated from the actual plot data.</p></dd><dt><span class="term"><em class="replaceable"><code>$ymax</code></em></span></dt><dd><p>Optional argument specifying the desired Y data range maximum value.If omitted or NULL, the value is calculated from the actual plot data.</p></dd></dl></div></div><div class="refsect1"><a id="idp1378582308"></a><h2>Notes</h2><p>Trailing defaulted arguments can be omitted, but non-trailing defaultedarguments must be specified as NULL. For example, to set the minimum Xvalue to 10, the maximum X value to 100, and default the Y scaling, you canuse:</p><pre class="programlisting">$plot->SetPlotAreaWorld(10, NULL, 100);</pre><p></p><p>This function has no effect with pie charts, because they do not use worldcoordinates.</p><p>See <a class="xref" href="adv-autorange.html" title="4.6. Plot Range and Tick Increment Calculations">Section 4.6, “Plot Range and Tick Increment Calculations”</a> for more information about how PHPlotcalculates the limits of the World Coordinate space in the absence of valuesset with <code class="function">SetPlotAreaWorld</code>.</p></div><div class="refsect1"><a id="idp1378584932"></a><h2>History</h2><p>Starting with PHPlot-6.0.0, <code class="function">SetPlotAreaWorld</code> willstop with an error if a fully specified range is invalid. That is, ifboth $xmin and $xmax are given and not NULL, $xmin must be less than $xmax.If both $ymin and $ymax are given and not NULL, $ymin must be less than $ymax.In older versions, this error was not detected.</p><p><code class="function">SetPlotAreaPixels</code> and <code class="function">SetPlotAreaWorld</code>can be called in either order.Through PHPlot-5.0.4 this was because SetPlotAreaWorld wouldreset the scale factors if <a class="xref" href="SetPlotAreaPixels.html" title="SetPlotAreaPixels"><span class="refentrytitle">SetPlotAreaPixels</span></a> was alreadycalled.Starting with PHPlot-5.0.5, both functions just store the information,and no calculations take place until <a class="xref" href="DrawGraph.html" title="DrawGraph"><span class="refentrytitle">DrawGraph</span></a> is used.</p><p>Through PHPlot-5.0.4, SetPlotAreaWorld needed to access and interpret the dataarray, so it had to be called after <a class="xref" href="SetDataValues.html" title="SetDataValues"><span class="refentrytitle">SetDataValues</span></a> sets thedata array, and after <a class="xref" href="SetDataType.html" title="SetDataType"><span class="refentrytitle">SetDataType</span></a> (if used).Starting with PHPlot-5.0.5, this restriction no longer applies and thefunctions can be called in any order.</p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="SetPlotAreaPixels.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="SetPlotBgColor.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">SetPlotAreaPixels </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> SetPlotBgColor</td></tr></table></div></body></html>