3D Scatter

Weather Station Network

Climate monitoring stations plotted by location and altitude, colored by temperature.

Output
Weather Station Network
Python
import matplotlib.pyplot as plt
import numpy as np

np.random.seed(999)

# Climate stations: latitude, altitude, temperature
n_stations = 120

latitude = np.random.uniform(25, 65, n_stations)
longitude = np.random.uniform(-125, -70, n_stations)
altitude = np.abs(np.random.exponential(500, n_stations))

# Temperature depends on latitude and altitude
temperature = 30 - 0.5 * latitude - 0.006 * altitude + np.random.normal(0, 3, n_stations)

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

scatter = ax.scatter(longitude, latitude, altitude, c=temperature, cmap='RdYlBu_r', 
                     s=60, alpha=0.8, edgecolors='#374151', linewidths=0.5)

cbar = plt.colorbar(scatter, ax=ax, shrink=0.6, pad=0.1)
cbar.set_label('Temperature (°C)', color='#1f2937', fontsize=10)
cbar.ax.tick_params(colors='#6b7280')

ax.set_xlabel('Longitude', color='#1f2937', fontsize=10)
ax.set_ylabel('Latitude', color='#1f2937', fontsize=10)
ax.set_zlabel('Altitude (m)', color='#1f2937', fontsize=10)
ax.set_title('Weather Station Network', 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=25, azim=45)
plt.tight_layout()
plt.show()
Library

Matplotlib

Category

3D Charts

Did this help you?

Support PyLucid to keep it free & growing

Support