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>SetNumYTicks</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="SetNumXTicks.html" title="SetNumXTicks" /><link rel="next" href="SetOutputFile.html" title="SetOutputFile" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">SetNumYTicks</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="SetNumXTicks.html">Prev</a> </td><th width="60%" align="center">PHPlot Function Reference</th><td width="20%" align="right"> <a accesskey="n" href="SetOutputFile.html">Next</a></td></tr></table><hr /></div><div class="refentry"><a id="SetNumYTicks"></a><div class="titlepage"></div><div class="refnamediv"><h2><span class="refentrytitle">SetNumYTicks</span></h2><p>SetNumYTicks — Set the number of Y tick intervals</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">$plot->SetNumYTicks([<span class="optional"><em class="parameter"><code>$nt</code></em></span>])</pre></div><div class="refsect1"><a id="idp1378426316"></a><h2>Description</h2><p><code class="function">SetNumYTicks</code> sets the number of tick intervals alongthe Y axis.You can use either this function or <a class="xref" href="SetYTickIncrement.html" title="SetYTickIncrement"><span class="refentrytitle">SetYTickIncrement</span></a>(but not both) to control the tick mark spacing.</p></div><div class="refsect1"><a id="idp1378427780"></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="idp1378429332"></a><h2>Notes</h2><p><code class="function">SetNumYTicks</code> sets the number of intervals intowhich PHPlot divides the Y data range. If there are N intervals, there mightbe 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="SetYTickAnchor.html" title="SetYTickAnchor"><span class="refentrytitle">SetYTickAnchor</span></a>, or if PHPlot is told to omit tick marks fromeither end with <a class="xref" href="SetSkipBottomTick.html" title="SetSkipBottomTick"><span class="refentrytitle">SetSkipBottomTick</span></a>or <a class="xref" href="SetSkipTopTick.html" title="SetSkipTopTick"><span class="refentrytitle">SetSkipTopTick</span></a>.</p><p>If you use <code class="function">SetNumYTicks</code>, you will get exactly that manytick intervals, regardless of whether the resulting tick increment is awhole number. In general, you would only use <code class="function">SetNumYTicks</code>when also using <a class="xref" href="SetPlotAreaWorld.html" title="SetPlotAreaWorld"><span class="refentrytitle">SetPlotAreaWorld</span></a> to specify both endsof the Y plot range. For example:</p><pre class="programlisting">$plot->SetPlotAreaWorld(NULL, -10, NULL, 10);$plot->SetNumXTicks(20);</pre><p>You will have a Y range from -10 to 10, with 20 intervals of 1 unit each.</p><p>If neither <code class="function">SetNumYTicks</code> nor<a class="xref" href="SetYTickIncrement.html" title="SetYTickIncrement"><span class="refentrytitle">SetYTickIncrement</span></a> is used, the tick intervalis 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="idp1378434996"></a><h2>History</h2><p>Before PHPlot-6.0.0, if neither the number of ticks nor the tick incrementwas specified, PHPlot calculated the tick increment as 1/10 of the Y datarange.Starting with PHPlot-6.0.0, a more complex algorithm is used which triesto produce 'natural' tick increments.</p><p>Starting with PHPlot-6.0.0, if you call both <code class="function">SetNumYTicks</code>and <code class="function">SetYTickIncrement</code>, the tick increment has priorityand the specified number of ticks is ignored.Before PHPlot-6.0.0, the behavior was order-dependent: whichever functionwas 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">SetNumYTicks('')</code>.Starting with PHPlot-5.3.1, the argument may be omitted to restore thedefault behavior.</p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="SetNumXTicks.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="SetOutputFile.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">SetNumXTicks </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> SetOutputFile</td></tr></table></div></body></html>