According to Single-page reference in R
The data the describes the coordinates of the surface is set in
z
. Data inz
should be a 2D list. Coordinates inx
andy
can either be 1D lists or {2D arrays} (e.g. to graph parametric surfaces). If not provided inx
andy
, the x and y coordinates are assumed to be linear starting at 0 with a unit step. The color scale corresponds to thez
values by default. For custom color scales, usesurfacecolor
which should be a 2D list, where its bounds can be controlled usingcmin
andcmax
.
What is z
exactly? I expected it to be z
values, so I would expect it to be 1D, but apparently it’s expecting a 2D array? What do I plug in there?