You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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:
Before Interpolation.
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])
Activity
tarzzz commentedon Mar 12, 2016
You can set the line properties to spline in the trace:
Example:
This is how it renders: https://plot.ly/~tarzzz/1874/
:)
vidhyadhari commentedon Mar 14, 2016
@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.
jackparmer commentedon May 20, 2016
See:
In this issue: plotly/plotly.js#130 (comment)