so I am graphing some simulations of time series data where I want to be able to visualize the distribution of the ending values in Python. Given the plot of simulated paths, I want to be able to take the values at the end (time = T) and use a distribution graph (just line, not box) that shows up on the right side of the graph showing the skew. I've provided an image example here:
我使用Plot来生成图表,因为我希望能够获得每个时间点的悬停数据.我使用的数据是通用的,所以任何形式的模拟路径在任何时间范围内都有效.我当前的图形代码如下:
import plotly.express as px
import plotly.graph_objects as go
from plotly.graph_objs.scatter.marker import Line
fig = go.Figure(go.Scatter(
x=y_testing.index,
y=y_testing.iloc[:, 0]
))
for i in range(1, len(y_testing.columns)-1):
fig.add_trace(go.Scatter(
x=y_testing.index,
y=y_testing.iloc[:, i]
))
fig.show()
- Y_Testing.index是时间段
- Y_Testing.iloc[:,0]是实际数据
- Y_Testing.iloc[:,i]是各自的模拟路径