Surface plot of 2 time series in a 3d plot over time in python

Viewed 37

I have tried to plot the following:

fig = plt.figure(figsize=(10, 10))
ax = plt.axes(projection='3d')

t6 = time.t.iloc[6]
x6 = df_pi['case_1_40_pi']
y6 = df_stock['case_1_40_st']

t5 = time.t.iloc[5]
x5 = df_pi['case_1_35_pi']
y5 = df_stock['case_1_35_st']

t4 = time.t.iloc[4]
x4 = df_pi['case_1_30_pi']
y4 = df_stock['case_1_30_st']

t3 = time.t.iloc[3]
x3 = df_pi['case_1_20_pi']
y3 = df_stock['case_1_20_st']

t2 = time.t.iloc[2]
x2 = df_pi['case_1_10_pi']
y2 = df_stock['case_1_10_st']

t1 = time.t.iloc[1]
x1 = df_pi['case_1_5_pi']
y1 = df_stock['case_1_5_st']

t = time.t.iloc[0]
x = df_pi['case_1_1_pi']
y = df_stock['case_1_1_st']

ax.plot3D(x, y, t)
ax.plot3D(x1, y1, t1)
ax.plot3D(x2, y2, t2)
ax.plot3D(x3, y3, t3)
ax.plot3D(x4, y4, t4)
ax.plot3D(x5, y5, t5)
ax.plot3D(x6, y6, t6)
plt.show()

Which gives me the following plot: The z axis is the stock price, the y and x axis are two series

The z axis is the stock price, the y and x axis are two series. I have two data frames for each process and a dataframe to store the time periods (1, 5, 10, 15, 20, 30, 35, 40). So by time t=1 I would like to plot the two processes against one another. Then to place all of them in a 3d surface plot. Something similar to this: Plotly 3D surface plot in R time for series data

Can anyone help me with this?

0 Answers
Related