Skip to content

Implement "connectgaps" for surface traces #2812

Closed
@benauriemma

Description

@benauriemma

I'm trying to create a surface plot, but it is not always the case that every point within the range I'm plotting over is defined. That is, my z matrix might resemble:

[
    [0, 1, 2, 3],
    [1, 2, 3, 4],
    [2, 3, undefined, 5],
    [3, 4, 5, 6]
]

If I try to create a surface plot using the above as the z matrix, the surface gets cut off and not all of the data is plotted. If I replace undefined with null or NaN, the same happens. If I replace undefined with empty, the code fails.

The only way I can get the rest of the data to plot is by replacing undefined with 0. However, this "pulls" the surrounding surface down to 0, which is misleading and especially problematic when all other data is much greater than 0.

I would be shocked if plotting an incomplete dataset is not a very common use case, and currently there's no good way to do it. I believe it would be usefull to provide a more intelligent handling for missing data. This could be leaving part of the surface out, or interpolating the missing value from surrounding values.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions