Skip to main content

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.

Classleague_codeDescription
NCAAMLacrosseFieldncaamA subclass of LacrosseField specific to NCAA men's lacrosse.
NCAAWLacrosseFieldncaawA subclass of LacrosseField specific to NCAA women's lacrosse.
NLLFieldnllA subclass of LacrosseField specific to the NLL (box lacrosse).
PLLFieldpllA subclass of LacrosseField specific to the PLL.
USAMLacrosseFieldusamA subclass of LacrosseField specific to USA Lacrosse (men's).
USAWLacrosseFieldusawA subclass of LacrosseField specific to USA Lacrosse (women's).
WorldLacrosseFieldworld lacrosseA 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. If None is supplied, then the currently-active Axes object will be used
  • display_range (str): "full" (the default), "in_bounds_only", "offense" or "defense"; see the class documentation
  • xlim (tuple or None): The x limits to display (overrides display_range)
  • ylim (tuple or None): The y limits to display (overrides display_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).