Graphics Reference
In-Depth Information
interleave(mtcars$mpg, min(mtcars$mpg)),
alpha
=
0.4
, col
=
"blue"
)
# Draw the box.
rgl.bbox(color
=
"grey50"
,
# grey60 surface and black text
emission
=
"grey50"
,
# emission color is grey50
xlen
=
0
, ylen
=
0
, zlen
=
0
)
# Don't add tick marks
# Set default color of future objects to black
rgl.material(color
=
"black"
)
# Add axes to specific sides. Possible values are "x--", "x-+", "x+-", and "x++".
axes3d(edges
=
c(
"x--"
,
"y+-"
,
"z--"
),
ntick
=
6
,
# Attempt 6 tick marks on each side
cex
=
.75
)
# Smaller font
# Add axis labels. 'line' specifies how far to set the label from the axis.
mtext3d(
"Weight"
, edge
=
"x--"
, line
=
2
)
mtext3d(
"Displacement"
, edge
=
"y+-"
, line
=
3
)
mtext3d(
"MPG"
,
edge
=
"z--"
, line
=
3
)
Figure 13-16. Left: 3D scatter plot with axis ticks and labels repositioned; right: from a different
point of view
See Also
See
?plot3d
for more options for controlling the output.