From 989c91d16ac6e4fce0f227f6b05ca74a00062600 Mon Sep 17 00:00:00 2001 From: Alon Grinberg Dana Date: Wed, 20 Nov 2024 17:45:26 +0200 Subject: [PATCH] f idt --- t3/simulate/cantera_IDT.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/t3/simulate/cantera_IDT.py b/t3/simulate/cantera_IDT.py index 165a763a..6aacdd3d 100644 --- a/t3/simulate/cantera_IDT.py +++ b/t3/simulate/cantera_IDT.py @@ -6,6 +6,7 @@ from typing import List, Optional, Tuple import concurrent.futures as cf import matplotlib.pyplot as plt +from matplotlib.ticker import ScalarFormatter import os import traceback @@ -437,6 +438,9 @@ def compute_idt(time_history: ct.SolutionArray, plt.xlabel('Time (s)') plt.ylabel(f'[{radical_label}]') plt.title(f'IDT = {idt:.2e} s') + ax = plt.gca() + ax.xaxis.set_major_formatter(ScalarFormatter(useMathText=True)) + ax.xaxis.get_major_formatter().set_scientific(True) if times[idt_index_c] > times[idt_index_dc_dt] * 2.5: x_min = min(times[idt_index_dc_dt] * 0.8, times[np.argmax(concentration)] * 0.1) x_max = max(times[idt_index_dc_dt] * 1.2, times[np.argmax(concentration)] * 1.5)