Skip to content

Commit 5cfc22d

Browse files
RDaxinikandersolarechedey-ls
committed
Update average_photon_energy.py
update legend Co-Authored-By: Kevin Anderson <[email protected]> Co-Authored-By: Echedey Luis <[email protected]>
1 parent 7687ddb commit 5cfc22d

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

docs/examples/spectrum/average_photon_energy.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""
22
Average Photon Energy Calculation
3-
============================
3+
=================================
44
55
Calculation of the Average Photon Energy from SPECTRL2 output.
66
"""
@@ -85,12 +85,12 @@
8585
plt.ylim(0, 1.8)
8686
plt.ylabel(r"Spectral irradiance (Wm⁻²nm⁻¹)")
8787
plt.xlabel(r"Wavelength (nm)")
88-
time_labels = times.strftime("%H:%M")
88+
time_labels = times.strftime("%H%M")
8989
labels = [
90-
"{}, AM={:0.02f}".format(*vals)
91-
for vals in zip(time_labels, relative_airmass)
90+
f"{t}, {am_:0.02f}"
91+
for t, am_ in zip(time_labels, relative_airmass)
9292
]
93-
plt.legend(labels)
93+
plt.legend(labels, title="Time, AM")
9494
plt.show()
9595

9696
# %%
@@ -116,12 +116,12 @@
116116
plt.ylim(0, 0.0018)
117117
plt.ylabel(r"Normalised Irradiance (nm⁻¹)")
118118
plt.xlabel(r"Wavelength (nm)")
119-
time_labels = times.strftime("%H:%M")
119+
time_labels = times.strftime("%H%M")
120120
labels = [
121-
"{}, AM={:0.02f}".format(*vals)
122-
for vals in zip(time_labels, relative_airmass)
121+
f"{t}, {am_:0.02f}"
122+
for t, am_ in zip(time_labels, relative_airmass)
123123
]
124-
plt.legend(labels)
124+
plt.legend(labels, title="Time, AM")
125125
plt.show()
126126

127127
# %%
@@ -165,12 +165,12 @@
165165
plt.ylim(0, 0.0018)
166166
plt.ylabel(r"Normalised Irradiance (nm⁻¹)")
167167
plt.xlabel(r"Wavelength (nm)")
168-
time_labels = times.strftime("%H:%M")
168+
time_labels = times.strftime("%H%M")
169169
labels = [
170-
"{}, APE={:0.02f}".format(*vals)
171-
for vals in zip(time_labels, ape)
170+
f"{t}, {ape_:0.02f}"
171+
for t, ape_ in zip(time_labels, ape)
172172
]
173-
plt.legend(labels)
173+
plt.legend(labels, title="Time, APE (eV)")
174174
plt.show()
175175

176176
# %%

0 commit comments

Comments
 (0)