Lacrosse
from sportypy.surfaces.lacrosse import LacrosseField
LacrosseField
A lacrosse field, as sportyR's geom_lacrosse().
league_code is one of "ncaam", "ncaaw", "nll", "pll", "usam", "usaw" or "world lacrosse" (case-insensitive). field_params takes the keys of sportyR's lacrosse dimensions (see cani_change_dimensions()), the colours are listed by cani_color_features(), and draw() accepts a display_range of "full", "in_bounds_only", "offense" or "defense" (and sportyR's other spellings of these).
Leagues
Each class below is a LacrosseField with that league's rule-book dimensions.
| Class | league_code | Description |
|---|---|---|
NCAAMLacrosseField | ncaam | A subclass of LacrosseField specific to NCAA men's lacrosse. |
NCAAWLacrosseField | ncaaw | A subclass of LacrosseField specific to NCAA women's lacrosse. |
NLLField | nll | A subclass of LacrosseField specific to the NLL (box lacrosse). |
PLLField | pll | A subclass of LacrosseField specific to the PLL. |
USAMLacrosseField | usam | A subclass of LacrosseField specific to USA Lacrosse (men's). |
USAWLacrosseField | usaw | A subclass of LacrosseField specific to USA Lacrosse (women's). |
WorldLacrosseField | world lacrosse | A subclass of LacrosseField specific to World Lacrosse (box). |
Methods
draw
LacrosseField.draw(ax = None, display_range = 'full', xlim = None, ylim = None, rotation = None)
Draw the field.
Parameters
ax(matplotlib.Axes): An Axes object onto which the plot can be drawn. IfNoneis supplied, then the currently-active Axes object will be useddisplay_range(str):"full"(the default),"in_bounds_only","offense"or"defense"; see the class documentationxlim(tuple or None): Thexlimits to display (overridesdisplay_range)ylim(tuple or None): Theylimits to display (overridesdisplay_range)rotation(float or None): Degrees to rotate the field through (counterclockwise)
Returns
ax(matplotlib.Axes): An Axes object with the field drawn on it
cani_plot_leagues
LacrosseField.cani_plot_leagues(league_code = None)
Print whether league_code ships with sportypy, or every league that does.
cani_color_features
LacrosseField.cani_color_features()
Print the features that can be coloured, with their current colours.
cani_change_dimensions
LacrosseField.cani_change_dimensions()
Print the field's parameters, with their current values.
update_colors
LacrosseField.update_colors(color_updates = None, *args, **kwargs)
Re-draw the field's features with color_updates applied.
update_field_params
LacrosseField.update_field_params(field_param_updates = None, *args, **kwargs)
Re-draw the field with field_param_updates applied.
reset_colors
LacrosseField.reset_colors()
Go back to the default colours (sportyR's).
reset_field_params
LacrosseField.reset_field_params()
Go back to the league's dimensions (in the field's current units).