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>SetNumXTicks</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="SetNumberFormat.html" title="SetNumberFormat" /><link rel="next" href="SetNumYTicks.html" title="SetNumYTicks" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">SetNumXTicks</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="SetNumberFormat.html">Prev</a> </td><th width="60%" align="center">PHPlot Function Reference</th><td width="20%" align="right"> <a accesskey="n" hre
f="SetNumYTicks.html">Next</a></td></tr></table><hr /></div><div class="refentry"><a id="SetNumXTicks"></a><div class="titlepage"></div><div class="refnamediv"><h2><span class="refentrytitle">SetNumXTicks</span></h2><p>SetNumXTicks — Set the number of X tick intervals</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">$plot->SetNumXTicks([<span class="optional"><em class="parameter"><code>$nt</code></em></span>])</pre></div><div class="refsect1"><a id="idp1378412428"></a><h2>Description</h2><p>
<code class="function">SetNumXTicks</code> sets the number of tick intervals along
the X axis.
You can use either this function or <a class="xref" href="SetXTickIncrement.html" title="SetXTickIncrement"><span class="refentrytitle">SetXTickIncrement</span></a>
(but not both) to control the tick mark spacing.
</p></div><div class="refsect1"><a id="idp1378413892"></a><h2>Parameters</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="replaceable"><code>$nt</code></em></span></dt><dd><p>
Integer number of tick intervals.
If the value is omitted or an empty string, the default behavior is restored.
</p></dd></dl></div></div><div class="refsect1"><a id="idp1378415444"></a><h2>Notes</h2><p>
<code class="function">SetNumXTicks</code> sets the number of intervals into
which PHPlot divides the X data range. If there are N intervals, there might
be as many as N+1 tick marks (accounting for one at each end).
Or, there might be N or N-1 tick marks, if a tick anchor is set with
<a class="xref" href="SetXTickAnchor.html" title="SetXTickAnchor"><span class="refentrytitle">SetXTickAnchor</span></a>, or if PHPlot is told to omit tick marks from
either end with <a class="xref" href="SetSkipLeftTick.html" title="SetSkipLeftTick"><span class="refentrytitle">SetSkipLeftTick</span></a>
or <a class="xref" href="SetSkipRightTick.html" title="SetSkipRightTick"><span class="refentrytitle">SetSkipRightTick</span></a>.
</p><p>
If you use <code class="function">SetNumXTicks</code>, you will get exactly that many
tick intervals, regardless of whether the resulting tick increment is a
whole number. In general, you would only use <code class="function">SetNumXTicks</code>
when also using <a class="xref" href="SetPlotAreaWorld.html" title="SetPlotAreaWorld"><span class="refentrytitle">SetPlotAreaWorld</span></a> to specify both ends
of the X plot range. For example:
</p><pre class="programlisting">$plot->SetPlotAreaWorld(0, NULL, 200);
$plot->SetNumXTicks(10);
</pre><p>
You will have an X range from 0 to 200, with 10 intervals of 20 units.
</p><p>
If neither <code class="function">SetNumXTicks</code> nor
<a class="xref" href="SetXTickIncrement.html" title="SetXTickIncrement"><span class="refentrytitle">SetXTickIncrement</span></a> is used, the tick interval
is automatically calculated by PHPlot.
See <a class="xref" href="adv-autorange.html#adv-autorange-tick" title="4.6.7. Automatic Tick Increment Calculation">Section 4.6.7, “Automatic Tick Increment Calculation”</a> for details.
</p></div><div class="refsect1"><a id="idp1378421100"></a><h2>History</h2><p>
Before PHPlot-6.0.0, if neither the number of ticks nor the tick increment
was specified, PHPlot calculated the tick increment as 1/10 of the X data
range.
Starting with PHPlot-6.0.0, a more complex algorithm is used which tries
to produce 'natural' tick increments.
</p><p>
Starting with PHPlot-6.0.0, if you call both <code class="function">SetNumXTicks</code>
and <code class="function">SetXTickIncrement</code>, the tick increment has priority
and the specified number of ticks is ignored.
Before PHPlot-6.0.0, the behavior was order-dependent: whichever function
was used last had priority.
</p><p>
Through PHPlot-5.3.0, the argument was required.
To restore the default behavior, it was necessary to use
<code class="literal">SetNumXTicks('')</code>.
Starting with PHPlot-5.3.1, the argument may be omitted to restore the
default behavior.
</p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="SetNumberFormat.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="SetNumYTicks.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">SetNumberFormat </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> SetNumYTicks</td></tr></table></div></body></html>