Implements plots of discrete functions (bar plots) and continuous functions (surface plots) in 3D. Uses orthographic projection, a nonstandard fixed viewing angle, does not support detailed axes and is designed to be relatively minimal and simple, from a programming perspective. However, does support mixed bar sizes and multiple colors. Refer the vignette for better examples
An optional vector of sorted x values. For bar plots, length(x) should equal nrow(z)+1. For surface plots, length(x) should equal nrow(z).
y
An optional vector of sorted y values. For bar plots, length(y) should equal ncol(z)+1. For surface plots, length(y) should equal ncol(z).
z
A matrix of z values. Increasing row indices correspond to increasing x values and increasing column indices correspond to increasing y values.
main
An optional main title.
xlab
The x label, defaults to x.
ylab
The y label, defaults to y.
zlim
An optional z range for the plot.
col1
The first color. For bar plots, may be a matrix.
col2
The second color. For bar plots, may be a matrix.
Details
Bar plots use two colors. The first color is the top of the bars and the second color is the front of the bars. Surface plots interpolate between two colors. Flatter regions are closer to the first color and steeper regions are closer to the second color.