I would like to make the same plot that is generated by the code below in plotly. I prefer to work with plotly, but I am having trouble creating the correct data structure to feed into plotly.
x = np.linspace(0.4,1.6,100)
y = np.linspace(0.4,1.6,100)
X, Y = np.meshgrid(x, y)
pos = np.dstack((X, Y))
C_1_means = np.array([1,1.375])
C_1_cov = np.array([[0.03,0.0167],[0.0167,0.0157]])
C_2_means = np.array([0.7,1.025])
C_2_cov = np.array([[0.008,0],[0,0.009]])
rv = multivariate_normal(C_1_means,C_1_cov)
Z_1 = rv.pdf(pos).tolist()
rv = multivariate_normal(C_2_means,C_2_cov)
Z_2 = rv.pdf(pos).tolist()
import matplotlib.pyplot as plt
plt.contour(X,Y,Z_1)
plt.contour(X,Y,Z_2)
plt.show()
I obtain this graph:
I have tried the following code below:
fig = go.Figure(data =
go.Contour(
z=Z_1,
x=X, # horizontal axis
y=Y # vertical axis
))
fig.show()

