Description
Some plotly trace types accepts input data in matrix format and the behavior of the trace changes whether the data is specified as a matrix or as a play 1D vector.
The issue comes from the serialization of JSON3 that by defaults serializes any ND-Array as its 1D content.
This can create issues that are different depending on the specific trace affected. I could identify the following problems in these traces, with some details in the examples below:
heatmap
surface
contour
Heatmap Example
The heatmap
trace can accept the z
values as a matrix, in which case the x
and y
values can be provided as the vectors generating the underlying grid.
If z
is provided as a vector, x
and y
also has to be provided as 1D vectors containing the x/y values of each single point in z.
This creates an issue when trying to provide z
as matrix and x
,y
as generating vectors in PlolyLight:
Surface Example
A different problem happens in surface
still when trying to provide x
and y
as generating vectors, where no Plot is produced with PlotlyLight:
Contour Example
Finally, something very weird that I don't understand happens with contour
. The plot is rendered but the resulting contour is not the correct one: