mirror of
https://github.com/logos-blockchain/logos-blockchain-simulations.git
synced 2026-02-17 11:43:09 +00:00
use scientific notation if values are too large in the tables
This commit is contained in:
parent
655be33d66
commit
9c32dc3241
@ -65,8 +65,8 @@ def analyze_versus(data: pd.DataFrame, x_field: str, outdir: str):
|
||||
columns = [x_field, "queue_type"] + flatten_fields
|
||||
table_data = max_paramset_data[columns].sort_values(by=[x_field, "queue_type"])
|
||||
# Prepare to display values with only 2 decimal places
|
||||
table_data[flatten_fields] = table_data[flatten_fields].applymap(
|
||||
lambda x: f"{x:.2f}"
|
||||
table_data[fields] = table_data[fields].map(
|
||||
lambda x: f"{x:.2e}" if abs(x) >= 1e6 else f"{x:.2f}"
|
||||
)
|
||||
# Display the table as a separate subplot
|
||||
fig_table, ax_table = plt.subplots(
|
||||
|
||||
@ -52,7 +52,9 @@ def analyze_versus(data: pd.DataFrame, x_field: str, outdir: str):
|
||||
columns = [x_field, "queue_type"] + fields
|
||||
table_data = max_paramset_data[columns].sort_values(by=[x_field, "queue_type"])
|
||||
# Prepare to display values with only 2 decimal places
|
||||
table_data[fields] = table_data[fields].applymap(lambda x: f"{x:.2f}")
|
||||
table_data[fields] = table_data[fields].map(
|
||||
lambda x: f"{x:.2e}" if abs(x) >= 1e6 else f"{x:.2f}"
|
||||
)
|
||||
# Display the table as a separate subplot
|
||||
fig_table, ax_table = plt.subplots(
|
||||
figsize=(len(columns) * 1.8, len(table_data) * 0.3)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user