Python Plotly - Why do the 2 surface plots show different results?

40 Views Asked by At

I'm trying 2 ways to plot surface plot, but not sure why I got different results.

First way I did:

import pandas as pd
import numpy as np
import cufflinks as cf
cf.go_offline()
from plotly.offline import download_plotlyjs,init_notebook_mode,plot,iplot
init_notebook_mode(connected=True)
import plotly.graph_objects as go

df3 = pd.DataFrame({'x':[1,2,3,4,5],'y':[10,20,30,20,10],'z':[5,4,3,2,1]})
go.Figure(data=go.Surface(x=df3['x'],y=df3['y'],z=[df3['z']]*5))

Plot1

Second way I did:

df3.iplot(kind='surface',x='x',y='y',z=['z']*5)

Plot2

0

There are 0 best solutions below