-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_plot_all.py
More file actions
25 lines (23 loc) · 889 Bytes
/
Copy path_plot_all.py
File metadata and controls
25 lines (23 loc) · 889 Bytes
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
import sys; sys.path.insert(0,'src')
from dataproc.stand_ppa import build_ppa_timeseries, plot_ppa
import matplotlib; matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np, math
anchors, ts_raw, ts = build_ppa_timeseries(r'Data\CMON\CMON-alat_latest.xlsx')
n_cols = 4
all_k = sorted(anchors['KOEALA'].unique())
n_per_fig = 16
for fi, start in enumerate(range(0, len(all_k), n_per_fig)):
batch = all_k[start:start + n_per_fig]
n_rows = math.ceil(len(batch) / n_cols)
fig, axes = plt.subplots(n_rows, n_cols, figsize=(5*n_cols, 4*n_rows))
af = np.array(axes).flat
for a, k in zip(af, batch):
plot_ppa(k, anchors, ts, ax=a)
for a in list(af)[len(batch):]:
a.set_visible(False)
fig.suptitle(f'fig{fi+1}')
plt.tight_layout()
plt.savefig(f'Results/ppa_all_{fi+1}.png', dpi=80)
plt.close()
print(f'fig{fi+1} done')