3D Scatter

Cryptocurrency Trading Analysis

Crypto market analysis with price changes, volatility, and volume colored by direction.

Output
Cryptocurrency Trading Analysis
Python
import matplotlib.pyplot as plt
import numpy as np

np.random.seed(555)

# Crypto trading data
n_trades = 200

price_change = np.random.normal(0, 5, n_trades)  # % change
volume = np.random.exponential(100, n_trades) + 10  # Million USD
volatility = np.abs(np.random.normal(0, 3, n_trades)) + 1

# Color by price direction
colors = ['#6CF527' if p > 0 else '#F5276C' for p in price_change]
sizes = volume / 2

fig = plt.figure(figsize=(10, 8), facecolor='#ffffff')
ax = fig.add_subplot(111, projection='3d', facecolor='#ffffff')

ax.scatter(price_change, volatility, volume, c=colors, s=sizes, 
           alpha=0.6, edgecolors='#374151', linewidths=0.3)

ax.set_xlabel('Price Change (%)', color='#1f2937', fontsize=10)
ax.set_ylabel('Volatility (%)', color='#1f2937', fontsize=10)
ax.set_zlabel('Volume ($M)', color='#1f2937', fontsize=10)
ax.set_title('Cryptocurrency Trading Analysis', color='#1f2937', fontsize=14, fontweight='bold', pad=20)

ax.tick_params(colors='#6b7280', labelsize=8)
ax.xaxis.pane.fill = False
ax.yaxis.pane.fill = False
ax.zaxis.pane.fill = False
ax.xaxis.pane.set_edgecolor('#e5e7eb')
ax.yaxis.pane.set_edgecolor('#e5e7eb')
ax.zaxis.pane.set_edgecolor('#e5e7eb')

ax.view_init(elev=20, azim=45)
plt.tight_layout()
plt.show()
Library

Matplotlib

Category

3D Charts

Did this help you?

Support PyLucid to keep it free & growing

Support