50 lines
1.8 KiB
Python
50 lines
1.8 KiB
Python
import matplotlib.pyplot as plt
|
|
import numpy as np
|
|
from mpl_toolkits.mplot3d import Axes3D
|
|
|
|
# Labels
|
|
x_labels = ['B5', 'B4', 'B3', 'B2', 'B1', 'N0', 'H1', 'H2', 'H3', 'H4', 'H5']
|
|
y_labels = ['B5', 'B4', 'B3', 'B2', 'B1', 'N0', 'H1', 'H2', 'H3', 'H4', 'H5']
|
|
|
|
# Data matrix
|
|
data = np.array([
|
|
[29.0, 33.8, 23.5, 26.2, 22.2, 8.1, 25.5, 39.3, 52.6, 62.6, 64.1],
|
|
[28.8, 22.5, 28.6, 34.9, 25.6, 19.1, 37.4, 45.2, 57.0, 69.4, 62.1],
|
|
[30.2, 24.2, 24.2, 25.7, 31.4, 28.1, 49.8, 56.9, 60.8, 68.8, 63.2],
|
|
[31.0, 24.5, 25.5, 25.2, 32.3, 40.0, 55.0, 61.9, 64.5, 69.0, 66.6],
|
|
[33.1, 30.2, 26.6, 29.3, 34.6, 47.8, 59.4, 69.4, 70.2, 71.6, 66.0],
|
|
[29.6, 29.5, 30.2, 32.1, 39.8, 56.2, 66.4, 71.5, 72.9, 73.0, 63.4],
|
|
[34.2, 30.4, 31.1, 36.8, 44.9, 62.5, 68.9, 72.1, 74.9, 74.7, 65.5],
|
|
[36.5, 31.3, 35.6, 42.3, 52.8, 68.1, 68.4, 77.0, 76.1, 74.4, 67.7],
|
|
[36.1, 34.2, 43.8, 49.1, 59.8, 77.7, 69.2, 73.5, 78.8, 72.5, 66.7],
|
|
[35.7, 42.2, 52.8, 62.5, 72.2, 87.8, 69.7, 68.1, 74.3, 75.2, 70.1],
|
|
[35.3, 48.3, 58.2, 72.1, 78.5, 96.5, 83.6, 69.1, 78.1, 69.9, 72.3]
|
|
])
|
|
|
|
# Meshgrid for 3D plotting
|
|
x = np.arange(len(x_labels))
|
|
y = np.arange(len(y_labels))
|
|
x, y = np.meshgrid(x, y)
|
|
z = data
|
|
|
|
# Plotting
|
|
fig = plt.figure(figsize=(12, 8))
|
|
ax = fig.add_subplot(111, projection='3d')
|
|
surf = ax.plot_surface(x, y, z, cmap='viridis', edgecolor='k')
|
|
|
|
# Axes settings
|
|
ax.set_xticks(np.arange(len(x_labels)))
|
|
ax.set_yticks(np.arange(len(y_labels)))
|
|
ax.set_xticklabels(x_labels)
|
|
ax.set_yticklabels(y_labels)
|
|
ax.set_xlabel('mid_smooth_deriv1_144_bin')
|
|
ax.set_ylabel('mid_smooth_deriv2_144_bin')
|
|
ax.set_zlabel('Probabilité de hausse (%)')
|
|
ax.set_title('Probabilité de hausse pour futur_percent_3h (%)')
|
|
|
|
# Colorbar
|
|
fig.colorbar(surf, ax=ax, shrink=0.5, aspect=10)
|
|
|
|
plt.tight_layout()
|
|
plt.show()
|