cyberosa
commited on
Commit
·
f81ac63
1
Parent(s):
c38f2c6
fixing legend on kl-divergence plot
Browse files- tabs/market_plots.py +1 -1
- tabs/trader_plots.py +0 -53
tabs/market_plots.py
CHANGED
@@ -30,7 +30,7 @@ def plot_kl_div_per_market(closed_markets: pd.DataFrame) -> gr.Plot:
|
|
30 |
xaxis_title="Markets closing Week",
|
31 |
yaxis_title="Kullback–Leibler divergence",
|
32 |
legend=dict(yanchor="top", y=0.5),
|
33 |
-
width=
|
34 |
height=600, # Adjusted for better fit on laptop screens
|
35 |
)
|
36 |
|
|
|
30 |
xaxis_title="Markets closing Week",
|
31 |
yaxis_title="Kullback–Leibler divergence",
|
32 |
legend=dict(yanchor="top", y=0.5),
|
33 |
+
width=800, # Adjusted for better fit on laptop screens
|
34 |
height=600, # Adjusted for better fit on laptop screens
|
35 |
)
|
36 |
|
tabs/trader_plots.py
CHANGED
@@ -85,59 +85,6 @@ def plot_trader_metrics_by_market_creator(
|
|
85 |
)
|
86 |
fig.update_xaxes(tickformat="%b %d\n%Y")
|
87 |
|
88 |
-
# # Add a vertical dashed line for the "multibet release"
|
89 |
-
# release_week = "Sep-29"
|
90 |
-
# # Extract unique categories to determine the position
|
91 |
-
# categories = traders_filtered["month_year_week"].unique()
|
92 |
-
|
93 |
-
# if release_week in categories:
|
94 |
-
# # Determine the numerical position of the release_week
|
95 |
-
# x_position = list(categories).index(release_week)
|
96 |
-
|
97 |
-
# # Add a vertical dashed line using add_shape
|
98 |
-
# fig.add_shape(
|
99 |
-
# type="line",
|
100 |
-
# x0=x_position,
|
101 |
-
# x1=x_position,
|
102 |
-
# y0=0,
|
103 |
-
# y1=1,
|
104 |
-
# xref="x",
|
105 |
-
# yref="paper",
|
106 |
-
# line=dict(color="darkred", dash="dash"),
|
107 |
-
# )
|
108 |
-
|
109 |
-
# # Add an annotation for the vertical line
|
110 |
-
# fig.add_annotation(
|
111 |
-
# x=x_position,
|
112 |
-
# y=0.8,
|
113 |
-
# xref="x",
|
114 |
-
# yref="paper",
|
115 |
-
# text="multibet release",
|
116 |
-
# showarrow=True,
|
117 |
-
# arrowhead=2,
|
118 |
-
# ax=0,
|
119 |
-
# ay=-40,
|
120 |
-
# font=dict(color="darkred"),
|
121 |
-
# bgcolor="gray",
|
122 |
-
# bordercolor="darkred",
|
123 |
-
# borderwidth=1,
|
124 |
-
# borderpad=4,
|
125 |
-
# align="center",
|
126 |
-
# )
|
127 |
-
# fig.add_vline(
|
128 |
-
# x=release_week, # The specific week for the release
|
129 |
-
# line_dash="dash", # Dashed line style
|
130 |
-
# line_color="darkred", # Color of the vertical line
|
131 |
-
# # annotation_text="multibet release",
|
132 |
-
# # annotation_text="multibet release", # Label for the vertical line
|
133 |
-
# # annotation_position="top", # Position of the annotation
|
134 |
-
# # annotation=dict(
|
135 |
-
# # bgcolor="white", # Background color for better readability
|
136 |
-
# # font_size=12,
|
137 |
-
# # font_color="red",
|
138 |
-
# # ),
|
139 |
-
# )
|
140 |
-
|
141 |
return gr.Plot(
|
142 |
value=fig,
|
143 |
)
|
|
|
85 |
)
|
86 |
fig.update_xaxes(tickformat="%b %d\n%Y")
|
87 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
return gr.Plot(
|
89 |
value=fig,
|
90 |
)
|