3D Scatter

Smart Building IoT Sensor Network

IoT sensor deployment in a smart building with status indicators across floor levels.

Output
Smart Building IoT Sensor Network
Python
import matplotlib.pyplot as plt
import numpy as np

np.random.seed(888)

# IoT sensor deployment
n_sensors = 120

# 3D building locations
x = np.random.uniform(0, 100, n_sensors)  # meters
y = np.random.uniform(0, 80, n_sensors)
z = np.random.choice([0, 3, 6, 9, 12], n_sensors)  # Floor levels

# Sensor readings
temperature = 22 + np.random.normal(0, 3, n_sensors) + z * 0.2
humidity = 50 + np.random.normal(0, 10, n_sensors)

# Status colors
status = np.random.choice(['normal', 'warning', 'critical'], n_sensors, p=[0.7, 0.2, 0.1])
colors = {'normal': '#27D3F5', 'warning': '#F5B027', 'critical': '#F5276C'}
point_colors = [colors[s] for s in status]

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

scatter = ax.scatter(x, y, z, c=point_colors, s=80, alpha=0.8, 
                     edgecolors='#374151', linewidths=0.5)

ax.set_xlabel('X Position (m)', color='#1f2937', fontsize=10)
ax.set_ylabel('Y Position (m)', color='#1f2937', fontsize=10)
ax.set_zlabel('Floor Level', color='#1f2937', fontsize=10)
ax.set_title('Smart Building IoT Sensor 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=35)
plt.tight_layout()
plt.show()
Library

Matplotlib

Category

3D Charts

Did this help you?

Support PyLucid to keep it free & growing

Support