Spaces:
Sleeping
Sleeping
dzs commited on
Commit ·
10ab487
1
Parent(s): 813741b
added dynamic log ticks to absolute option
Browse files
figure.py
CHANGED
|
@@ -99,6 +99,12 @@ def build_figure(dataframe: pd.DataFrame, mc_option="absolute") -> go.Figure:
|
|
| 99 |
np.nextafter(0.0, 1.0)
|
| 100 |
)
|
| 101 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 102 |
fig.update_layout(
|
| 103 |
barmode="group",
|
| 104 |
|
|
@@ -119,7 +125,15 @@ def build_figure(dataframe: pd.DataFrame, mc_option="absolute") -> go.Figure:
|
|
| 119 |
range=[
|
| 120 |
np.log10(y_min),
|
| 121 |
np.log10(1.0)
|
| 122 |
-
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 123 |
),
|
| 124 |
)
|
| 125 |
|
|
|
|
| 99 |
np.nextafter(0.0, 1.0)
|
| 100 |
)
|
| 101 |
|
| 102 |
+
# Adaptive log ticks
|
| 103 |
+
ticks = make_log_ticks(
|
| 104 |
+
y_min,
|
| 105 |
+
1.0
|
| 106 |
+
)
|
| 107 |
+
|
| 108 |
fig.update_layout(
|
| 109 |
barmode="group",
|
| 110 |
|
|
|
|
| 125 |
range=[
|
| 126 |
np.log10(y_min),
|
| 127 |
np.log10(1.0)
|
| 128 |
+
],
|
| 129 |
+
tickmode="array",
|
| 130 |
+
tickvals=ticks,
|
| 131 |
+
ticktext=[
|
| 132 |
+
f"{x:g}"
|
| 133 |
+
for x in ticks
|
| 134 |
+
],
|
| 135 |
+
gridcolor="lightgray",
|
| 136 |
+
gridwidth=1,
|
| 137 |
),
|
| 138 |
)
|
| 139 |
|