EVOLUTION-MANAGER
Edit File: axisTicks.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Compute Pretty Axis Tick Scales</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for axisTicks {grDevices}"><tr><td>axisTicks {grDevices}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Compute Pretty Axis Tick Scales</h2> <h3>Description</h3> <p>Compute pretty axis scales and tick mark locations, the same way as traditional <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> graphics do it. This is interesting particularly for log scale axes. </p> <h3>Usage</h3> <pre> axisTicks(usr, log, axp = NULL, nint = 5) .axisPars(usr, log = FALSE, nintLog = 5) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>usr</code></td> <td> <p>numeric vector of length 2, with <code>c(min, max)</code> axis extents.</p> </td></tr> <tr valign="top"><td><code>log</code></td> <td> <p>logical indicating if a log scale is (thought to be) in use.</p> </td></tr> <tr valign="top"><td><code>axp</code></td> <td> <p>numeric vector of length 3, <code>c(mi, ma, n.)</code>, with identical meaning to <code><a href="../../graphics/html/par.html">par</a>("?axp")</code> (where <code>?</code> is <code>x</code> or <code>y</code>), namely “pretty” axis extents, and an integer <em>code</em> <code>n.</code>. </p> </td></tr> <tr valign="top"><td><code>nint, nintLog</code></td> <td> <p>positive integer value indicating (<em>approximately</em>) the desired number of intervals. <code>nintLog</code> is used <b>only</b> for the case <code>log = TRUE</code>.</p> </td></tr> </table> <h3>Details</h3> <p><code>axisTicks(usr, *)</code> calls <code>.axisPars(usr, ..)</code> to set <code>axp</code> when that is missing or <code>NULL</code>. </p> <p>Apart from that, <code><a href="axisTicks.html">axisTicks</a>()</code> just calls the C function <code>CreateAtVector()</code> in ‘<span class="file"><Rsrc>/src/main/plot.c</span>’ which is also called by the base <span class="pkg">graphics</span> package function <code><a href="../../graphics/html/axis.html">axis</a>(side, *)</code> when its argument <code>at</code> is not specified. </p> <h3>Value</h3> <p><code>axisTicks()</code> returns a numeric vector of potential axis tick locations, of length approximately <code>nint+1</code>. </p> <p><code>.axisPars()</code> returns a <code><a href="../../base/html/list.html">list</a></code> with components </p> <table summary="R valueblock"> <tr valign="top"><td><code>axp</code></td> <td> <p>numeric vector of length 2, <code>c(min., max.)</code>, of pretty axis extents.</p> </td></tr> <tr valign="top"><td><code>n</code></td> <td> <p>integer (code), with the same meaning as <code><a href="../../graphics/html/par.html">par</a>("?axp")[3]</code>.</p> </td></tr> </table> <h3>See Also</h3> <p><code><a href="../../graphics/html/axTicks.html">axTicks</a></code>, <code><a href="../../graphics/html/axis.html">axis</a></code>, and <code><a href="../../graphics/html/par.html">par</a></code> all from the <span class="pkg">graphics</span> package. </p> <h3>Examples</h3> <pre> ##--- Demonstrating correspondence between graphics' ##--- axis() and the graphics-engine agnostic axisTicks() : require("graphics") plot(10*(0:10)); (pu <- par("usr")) aX <- function(side, at, ...) axis(side, at = at, labels = FALSE, lwd.ticks = 2, col.ticks = 2, tck = 0.05, ...) aX(1, print(xa <- axisTicks(pu[1:2], log = FALSE))) # x axis aX(2, print(ya <- axisTicks(pu[3:4], log = FALSE))) # y axis axisTicks(pu[3:4], log = FALSE, n = 10) plot(10*(0:10), log = "y"); (pu <- par("usr")) aX(2, print(ya <- axisTicks(pu[3:4], log = TRUE))) # y axis plot(2^(0:9), log = "y"); (pu <- par("usr")) aX(2, print(ya <- axisTicks(pu[3:4], log = TRUE))) # y axis </pre> <hr /><div style="text-align: center;">[Package <em>grDevices</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>