Skip to content

Contour Plot ends the run instead of saying what it cannot plot #8076

Description

@kz930

What happened?

The operator hands the three configured columns to scipy exactly as they arrive:

x = table[...].values
grid_x, grid_y = np.meshgrid(np.linspace(min(x), max(x), grid_size), ...)
grid_z = griddata((x, y), z, (grid_x, grid_y), method='cubic')

Three ordinary tables end the run there rather than drawing anything.

An empty table: min(x) raises "min() iterable argument is empty" before griddata is reached.

A blank cell in x or y: it arrives as NaN and griddata refuses it with "Points cannot contain NaN". A blank in z fails more quietly. The interpolation returns an all-NaN grid, so the chart is drawn empty with nothing to say why.

Points that all fall on one line: cubic interpolation triangulates first, and a set that does not span a plane raises the QhullError below. Three points not on a line are enough to draw, and two points never are, since two points are always on a line.

I expected it to say what it cannot plot, the way the other charts do. Bar Chart drops the rows missing either configured column and then renders an error page reading "Table should not have any empty/null values or fields", and Dumbbell Plot does the same. Contour Plot has no render_error at all and no guard of any kind.

The numeric type rules already declared on x, y and z do not help here. The values are numeric in all three cases.

How to reproduce?

  1. Build a table with numeric x, y and z columns and four rows, all of them on the line y = x.
  2. Connect Contour Plot and point x, y and z at those columns.
  3. Run.

The run ends with the error below. Moving one point off the line lets it draw. The empty-table and blank-cell cases end the run in the same place, with the messages quoted above.

Version/Branch

1.3.0-incubating-SNAPSHOT (main)

Relevant log output

scipy.spatial._qhull.QhullError: QH6154 Qhull precision error: Initial simplex is flat (facet 1 is coplanar with the interior point)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions