-
Notifications
You must be signed in to change notification settings - Fork 0
/
Hexbin plot
78 lines (68 loc) · 2.85 KB
/
Hexbin plot
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import pandas as pd
import matplotlib.pyplot as plt
# Set global font weight to bold
plt.rcParams['font.weight'] = 'bold'
# Make titles and axis labels bold
plt.rcParams['axes.titleweight'] = 'bold' # Title text
plt.rcParams['axes.labelweight'] = 'bold' # Axis labels
# Set global font size
plt.rcParams['font.size'] = 12 # Adjust the size as needed
# Set font size for specific elements
plt.rcParams['axes.titlesize'] = 14 # Title font size
plt.rcParams['axes.labelsize'] = 14 # Axis label font size
plt.rcParams['xtick.labelsize'] = 14 # X-tick label font size
plt.rcParams['ytick.labelsize'] = 14 # Y-tick label font size
plt.rcParams['legend.fontsize'] = 14 # Legend font size
# Load the newly uploaded dataset for the hexbin plot
file_path_new = ''
dataset_new = pd.read_csv(file_path_new)
# Set global font weight to bold
# plt.rcParams['font.weight'] = 'bold'
# plt.rcParams['axes.titleweight'] = 'bold' # Title text
plt.rcParams['axes.labelweight'] = 'bold' # Axis labels
# Plot hexbin for each column with added y-axis labels including units
plt.figure(figsize=(15, 15))
# Hexbin for PM1 with µg/m3 units
plt.subplot(3, 2, 1)
plt.hexbin(dataset_new['Time'], dataset_new['PM1'], gridsize=30, cmap='plasma', mincnt=1)
plt.title('PM1 Concentration over Time',fontsize=10)
plt.xlabel('Time (seconds)')
plt.ylabel('PM1 Concentration (µg/m3)')
plt.colorbar(label='PM1 Density')
# Hexbin for PM2.5 with µg/m3 units
plt.subplot(3, 2, 2)
plt.hexbin(dataset_new['Time'], dataset_new['PM2.5'], gridsize=30, cmap='plasma', mincnt=1)
plt.title('PM2.5 Concentration over Time',fontsize=10)
plt.xlabel('Time (seconds)')
plt.ylabel('PM2.5 Concentration (µg/m3)')
plt.colorbar(label='PM2.5 Density')
# Hexbin for PM10 with µg/m3 units
plt.subplot(3, 2, 3)
plt.hexbin(dataset_new['Time'], dataset_new['PM10'], gridsize=30, cmap='plasma', mincnt=1)
plt.title('PM10 Concentration over Time',fontsize=10)
plt.xlabel('Time (seconds)')
plt.ylabel('PM10 Concentration (µg/m3)')
plt.colorbar(label='PM10 Density')
# Hexbin for CO2 with ppm units
plt.subplot(3, 2, 4)
plt.hexbin(dataset_new['Time'], dataset_new['CO2'], gridsize=30, cmap='plasma', mincnt=1)
plt.title('CO2 Concentration over Time',fontsize=10)
plt.xlabel('Time (seconds)')
plt.ylabel('CO2 Concentration (ppm)')
plt.colorbar(label='CO2 Density')
# Hexbin for HCHO with mg/m3 units
plt.subplot(3, 2, 5)
plt.hexbin(dataset_new['Time'], dataset_new['HCHO'], gridsize=30, cmap='plasma', mincnt=1)
plt.title('HCHO Concentration over Time',fontsize=10)
plt.xlabel('Time (seconds)')
plt.ylabel('HCHO Concentration (mg/m3)')
plt.colorbar(label='HCHO Density')
# Hexbin for AQI
plt.subplot(3, 2, 6)
plt.hexbin(dataset_new['Time'], dataset_new['AQI'], gridsize=30, cmap='plasma', mincnt=1)
plt.title('AQI Concentration over Time',fontsize=10)
plt.xlabel('Time (seconds)')
plt.ylabel('AQI')
plt.colorbar(label='AQI Density')
plt.tight_layout()
plt.show()