Affichage graphique
This commit is contained in:
47
tools/statistique/vue_3d.py
Normal file
47
tools/statistique/vue_3d.py
Normal file
@@ -0,0 +1,47 @@
|
||||
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
|
||||
data = np.array([
|
||||
[40.3, 52.1, 60.2, 68.6, 86.3, 76.5, 75.1, 83.5, 88.7, 96.3, 91.6],
|
||||
[26.6, 39.4, 48.1, 57.0, 76.7, 82.4, 79.6, 82.4, 91.8, 86.6, 87.8],
|
||||
[21.5, 27.7, 42.7, 53.2, 70.9, 76.6, 80.8, 79.4, 88.3, 88.0, 87.8],
|
||||
[15.1, 20.8, 32.9, 46.9, 59.1, 79.6, 82.5, 79.6, 80.8, 87.0, 85.5],
|
||||
[15.7, 15.4, 21.9, 29.4, 48.3, 66.6, 76.4, 77.8, 80.8, 83.5, 81.4],
|
||||
[15.0, 10.5, 20.1, 24.5, 36.9, 59.9, 68.8, 74.1, 77.7, 83.0, 75.7],
|
||||
[14.8, 10.7, 15.1, 21.0, 30.1, 47.3, 59.2, 70.4, 76.1, 82.7, 82.6],
|
||||
[7.9, 8.6, 13.6, 20.6, 27.0, 39.5, 55.2, 68.9, 69.0, 78.4, 83.4],
|
||||
[9.2, 6.2, 12.6, 21.7, 23.6, 33.1, 42.3, 57.8, 66.0, 71.9, 81.9],
|
||||
[4.8, 13.1, 16.3, 14.5, 19.5, 26.4, 35.6, 49.2, 63.2, 68.2, 71.6],
|
||||
[17.9, 25.7, 20.8, 17.8, 8.7, 18.5, 32.3, 37.7, 49.3, 59.8, 61.7]
|
||||
])
|
||||
|
||||
# Meshgrid for 3D plotting
|
||||
x = np.arange(len(x_labels))
|
||||
y = np.arange(len(y_labels))
|
||||
x, y = np.meshgrid(x, y)
|
||||
|
||||
# Plot
|
||||
fig = plt.figure(figsize=(12, 8))
|
||||
ax = fig.add_subplot(111, projection='3d')
|
||||
surf = ax.plot_surface(x, y, data, cmap='viridis', edgecolor='k')
|
||||
|
||||
# Axis formatting
|
||||
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("sma144_diff_bin")
|
||||
ax.set_zlabel("Probabilité de hausse (%)")
|
||||
ax.set_title("Probabilité de hausse pour futur_percent_3h en 3D")
|
||||
|
||||
fig.colorbar(surf, shrink=0.5, aspect=10)
|
||||
|
||||
plt.tight_layout()
|
||||
plt.show()
|
||||
Reference in New Issue
Block a user