Modification of rgl::axis3d() that adds two extra parameters,
ticksize and labeldist, to independently control the length of the
axis tick marks and the distance between those tick marks and their
labels. Based on the solution proposed on Stack Overflow (see
References).
Usage
axis3(
edge,
at = NULL,
labels = TRUE,
tick = TRUE,
line = TRUE,
pos = NULL,
nticks = 5,
ticksize = 0.05,
labeldist = 3,
...
)Arguments
- edge
character string indicating the edge of the bounding box on which the axis is drawn (same format as in
rgl::axis3d(), e.g."z+-").- at
positions at which the tick marks are drawn; if
NULLthey are computed automatically withpretty().- labels
tick labels: logical, indicating whether to automatically label the axes or be omitted, or a vector of labels.
- tick
logical; if
TRUEthe axis tick marks are drawn.- line
logical; if
TRUEthe axis line is drawn.- pos
optional position of the axis (see
rgl::axis3d()).- nticks
approximate number of tick marks when
at = NULL.- ticksize
length of the tick marks, as a fraction of the distance to the center of the scene's range.
- labeldist
distance between the tick marks and the labels, as a multiple of
ticksize.- ...
additional arguments passed to
rgl::segments3d()andrgl::text3d().
Value
An rglId object (see rgl::lowlevel()) with the identifiers of the
rgl elements added (line, tick marks and labels).
References
Dominic Woolf (2013, Mar 23). R rgl distance between axis ticks and tick labels, Stack Overflow, https://stackoverflow.com/a/39299740/4303451.