ZH: prefer str.format with g over e

This commit is contained in:
Eric-Teunis de Boone 2023-04-28 17:14:49 +02:00
parent 5abed24ecf
commit 01164ddfae
7 changed files with 10 additions and 10 deletions

View file

@ -26,9 +26,9 @@ def save_overlapping_traces_figure(test_location, ev, N_plot = 30, wx=200, title
axs.set_title("Antenna traces" + (("\n" + title_extra) if title_extra is not None else '') )
axs.set_xlabel("Time [ns]")
axs.set_ylabel("Amplitude [$\\mu V/m$]")
if False:
if True:
text_loc = (0.02, 0.95)
axs.text(*text_loc, '[' + ', '.join(['{:.1e}'.format(x) for x in test_location]) + ']', ha='left', transform=axs.transAxes)
axs.text(*text_loc, '[' + ', '.join(['{:.1g}'.format(x) for x in test_location]) + ']', ha='left', transform=axs.transAxes)
a_max = [ np.amax(ant.E_AxB) for ant in ev.antennas ]
power_sort_idx = np.argsort(a_max)
@ -139,7 +139,7 @@ if __name__ == "__main__":
ev.antennas = antennas
# Read in snr info
beacon_snrs = beacon.read_snr_file(beacon_snr_fname)
snr_str = f"$\\langle SNR \\rangle$ = {beacon_snrs['mean']: .1e}"
snr_str = f"$\\langle SNR \\rangle$ = {beacon_snrs['mean']: .1g}"
##
## Setup grid