Skip to content

Implement "connectgaps" for surface traces #2812

Closed

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.

Activity

  1. changed the title [-]Intelligent handling of missing data for surface plots[/-] [+]Intelligent handling of missing data for surface plots type: feature request[/+] on Jul 12, 2018
  2. changed the title [-]Intelligent handling of missing data for surface plots type: feature request[/-] [+]Intelligent handling of missing data for surface plots[/+] on Jul 12, 2018
  3. etpinard commented on Jul 13, 2018

    @etpinard
    Contributor

    Adding a way to interpolate (assuming that's what you mean by "intelligent handling") for missing z values in surface would be great addition. In plotly.js lingo, we call this connectgaps: true as is already available for heatmap and contour traces.

    @benauriemma ok if change the issue title accordingly?

  4. benauriemma commented on Jul 13, 2018

    @benauriemma
    Author

    @etpinard , yes, I think that would be a great way of handling it intelligently. Github is not allowing me to change the title of the issue right now, but I will try again later.

    "connectgaps for surface plots with missing data"

  5. changed the title [-]Intelligent handling of missing data for surface plots[/-] [+]Implement "connectgaps" for surface traces[/+] on Jul 13, 2018
  6. added
    feature
    on Jul 13, 2018
  7. self-assigned this
    on Nov 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

feature

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions