-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plot arcs method #84
base: main
Are you sure you want to change the base?
Plot arcs method #84
Conversation
def plot_arcs_around_goals_on_pitches(pitch_cls): | ||
fig, axes = plt.subplots(4, 2, figsize=(12, 14)) | ||
axes = axes.ravel() | ||
pitch_types = ['statsbomb', 'opta', 'tracab', 'skillcorner', 'wyscout', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a simplified version of examples/pitch_setup/plot_compare_pitches.py
which I was using to make sure I dealt with the subtleties of the different coordinate systems and aspect ratios.
self._draw_arc( | ||
ax, ymin + self.pad_bottom, x, height, width, theta1=-90, theta2=90, **kwargs | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The _draw_arc
method on a VerticalPitch switches orientations for you. Due to how I worked out the co-ordinates I have 'undone' the switch in the arguments passed here so that it works out correctly. I was not really sure how to go about this in such a way that this extra switch wouldn't be needed.
Hi, I've had a go at issue #14 in this PR. I'm not sure if there are existing methods to achieve some of what I do in the methods, let me know if you know of easier ways :)
Below are screenshots of what the example will produce for both pitch orientations, plotting arcs at 5, 10, 20 and 30 metres: