Skip to content

Interpolation for 3d data in plotly #423

Description

@vidhyadhari

I need a way to create a smooth representation of 3d curves in plotly. Currently I have a set of points when I plot them I get step-wise points in plotly. Is there a way to avoid the step-wise variance in the plots and get a smooth curve?

I have thought of interpolation but it is smoothing out the curve completely by avoiding all the outliers.

Attaching the images.

screen shot 2016-03-11 at 2 54 39 pm
The blue line in this plot needs to be smoothed. It has lot of outliers which create that step effect when I plot that data.

Here is the output of interpolation:
5kdok
Before Interpolation.

tvndq
After Interpolation.

Any help on this would be great. Thanks.

Activity

  1. tarzzz commented on Mar 12, 2016

    @tarzzz
    Contributor

    You can set the line properties to spline in the trace:

    Example:

    import plotly.plotly as py
    import plotly.graph_objs as go
    import numpy as np
    
    x = np.linspace(1,10,num=50)
    y = np.random.rand(1,50)
    
    trace = go.Scatter(x=x,y=y[0],mode='lines', line=go.Line(shape='spline')) # Line shape is 'spline' here ..
    py.plot([trace])
    

    This is how it renders: https://plot.ly/~tarzzz/1874/
    :)

  2. vidhyadhari commented on Mar 14, 2016

    @vidhyadhari
    Author

    @tarzzz : Thanks for the reply.

    But the problem is the line.shape property is present in only 2d plots. I need a similar one for 3d line plots.

    In 3d I used Scatter3d function instead of just Scatter and the line object doesn't have shape object in it.

  3. jackparmer commented on May 20, 2016

    @jackparmer
    Contributor

    See:

    no line.shape

    In this issue: plotly/plotly.js#130 (comment)

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions