Update app.py
Browse files
app.py
CHANGED
|
@@ -316,9 +316,7 @@ def server(input, output, session):
|
|
| 316 |
"clip": True, # This helps constrain the brush to the plot area
|
| 317 |
"fill": "#00000033", # Optional: sets a semi-transparent fill
|
| 318 |
"stroke": "#000000", # Optional: sets the brush border color
|
| 319 |
-
|
| 320 |
-
"containment": "svg" # Constrain brush to the SVG area
|
| 321 |
-
}
|
| 322 |
}
|
| 323 |
|
| 324 |
|
|
@@ -553,6 +551,14 @@ def server(input, output, session):
|
|
| 553 |
plot_picker='short_form_movement',#plot_picker,
|
| 554 |
sport_id=sport_id)
|
| 555 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 556 |
# # Adjust the plot layout after creation
|
| 557 |
# plt.subplots_adjust(
|
| 558 |
# top=0.95, # Reduce top margin
|
|
|
|
| 316 |
"clip": True, # This helps constrain the brush to the plot area
|
| 317 |
"fill": "#00000033", # Optional: sets a semi-transparent fill
|
| 318 |
"stroke": "#000000", # Optional: sets the brush border color
|
| 319 |
+
|
|
|
|
|
|
|
| 320 |
}
|
| 321 |
|
| 322 |
|
|
|
|
| 551 |
plot_picker='short_form_movement',#plot_picker,
|
| 552 |
sport_id=sport_id)
|
| 553 |
|
| 554 |
+
|
| 555 |
+
# Add clip path to constrain brush
|
| 556 |
+
for ax in fig.get_axes():
|
| 557 |
+
if ax.get_xlabel() == 'Horizontal Break (in)': # Identify the main plot
|
| 558 |
+
ax.set_clip_on(True)
|
| 559 |
+
ax.patch.set_clip_on(True)
|
| 560 |
+
for artist in ax.get_children():
|
| 561 |
+
artist.set_clip_on(True)
|
| 562 |
# # Adjust the plot layout after creation
|
| 563 |
# plt.subplots_adjust(
|
| 564 |
# top=0.95, # Reduce top margin
|