1

I have data below with much more data points. I want to create a heatmap(potential landscape) of X,Y, Z.

X and Y are the positions, whilst Z is the corresponding values of the position for coloring. They're in three arrays of equal length.

X = [0.2, -1.78, -3.82, -1.34]
Y = [9.18, 9.87, 7.75, 9.38]
Z = [6.85, 7.51, 7.32, 6.98]
df_qp = pd.DataFrame(list(zip(X,Y,Z)), columns = ['PC1', 'PC2', 'QP'])

I mad grid like that

xx, yy = np.meshgrid(X, Y)

and

plt.pcolormesh(xx,yy,Z)

is not working and I think I have to arrange Z data to 2D array and I don't how to arrange the data. Can someone give me some advice? Or are there better plots for the data?

0 Answers0