dea_tools.landcover

Plotting and animating Digital Earth Australia Land Cover data.

License: The code in this notebook is licensed under the Apache License, Version 2.0 (https://www.apache.org/licenses/LICENSE-2.0). Digital Earth Australia data is licensed under the Creative Commons by Attribution 4.0 license (https://creativecommons.org/licenses/by/4.0/).

Contact: If you need assistance, please post a question on the Open Data Cube Discord chat (https://discord.com/invite/4hhBQVas5U) or on the GIS Stack Exchange (https://gis.stackexchange.com/questions/ask?tags=open-data-cube) using the open-data-cube tag (you can view previously asked questions here: https://gis.stackexchange.com/questions/tagged/open-data-cube).

If you would like to report an issue with this script, you can file one on GitHub (GeoscienceAustralia/dea-notebooks#new).

Last modified: May 2025

Functions

get_colour_scheme(measurement)

Retrieves a colour scheme dictionary for a specified measurement.

get_label(lc_value, level[, lc_dictionary])

Returns the name of the Land Cover class given its value.

lc_animation(da[, file_name, measurement, ...])

Creates an animation of DEA Landcover though time beside corresponding stacked plots of the landcover classes.

lc_colourmap(colour_scheme)

Takes a colour scheme dictionary and returns colormap for matplotlib.

make_colourbar(fig, ax, measurement[, ...])

Adds a new colourbar with appropriate Land Cover colours and labels.

plot_land_cover(data[, labelsize, year, ...])

Plot a single land cover measurement with appropriate colour scheme.

dea_tools.landcover.get_colour_scheme(measurement)[source]

Retrieves a colour scheme dictionary for a specified measurement.

This function determines the appropriate colour scheme based on a given measurement name. If the measurement refers to a descriptor, the colour scheme is built from the descriptor definitions. Otherwise, a standard predefined colour scheme is returned.

Parameters:

measurement (str) – The name of the measurement or descriptor for which the colour scheme is requested. Must match a key in lc_colours, lc_colours_mapping, or aliases.

Returns:

colour_scheme – Dictionary containing the colour scheme associated with the specified measurement or descriptor.

Return type:

dict

dea_tools.landcover.get_label(lc_value, level, lc_dictionary={'level3': {111: (172, 188, 45, 255, 'Cultivated\nTerrestrial\nVegetation'), 112: (14, 121, 18, 255, 'Natural\nTerrestrial\nVegetation'), 124: (30, 191, 121, 255, 'Natural\nAquatic\nVegetation'), 215: (218, 92, 105, 255, 'Artificial\nSurface'), 216: (243, 171, 105, 255, 'Natural\nBare\nSurface'), 220: (77, 159, 220, 255, 'Water'), 255: (255, 255, 255, 255, 'No Data')}, 'level3_change_colour_bar': {0: (255, 255, 255, 255, 'No Change'), 111: (172, 188, 45, 255, 'Changed to Cultivated\n Terrestrial Vegetation'), 112: (14, 121, 18, 255, 'Changed to Natural\n Terrestrial Vegetation'), 124: (30, 191, 121, 255, 'Changed to Natural\n Aquatic Vegetation'), 215: (218, 92, 105, 255, 'Changed to Artificial\n Surface'), 216: (243, 171, 105, 255, 'Changed to Natural\n Bare Surface'), 220: (77, 159, 220, 255, 'Changed to Water')}, 'level3_change_colour_scheme': {0: (255, 255, 255, 255, 'No Change'), 111112: (14, 121, 18, 255, 'CTV -> NTV'), 111215: (218, 92, 105, 255, 'CTV -> AS'), 111216: (243, 171, 105, 255, 'CTV -> BS'), 111220: (77, 159, 220, 255, 'CTV -> Water'), 112111: (172, 188, 45, 255, 'NTV -> CTV'), 112215: (218, 92, 105, 255, 'NTV -> AS'), 112216: (243, 171, 105, 255, 'NTV -> BS'), 112220: (77, 159, 220, 255, 'NTV -> Water'), 124220: (77, 159, 220, 255, 'NAV -> Water'), 215111: (172, 188, 45, 255, 'AS -> CTV'), 215112: (14, 121, 18, 255, 'AS -> NTV'), 215216: (243, 171, 105, 255, 'AS -> BS'), 215220: (77, 159, 220, 255, 'AS -> Water'), 216111: (172, 188, 45, 255, 'BS -> CTV'), 216112: (14, 121, 18, 255, 'BS -> NTV'), 216215: (218, 92, 105, 255, 'BS -> AS'), 216220: (77, 159, 220, 255, 'BS -> Water'), 220112: (14, 121, 18, 255, 'Water -> NTV'), 220216: (243, 171, 105, 255, 'Water -> BS')}, 'level4': {1: (151, 187, 26, 255, 'Cultivated Terrestrial\n Vegetated:'), 2: (151, 187, 26, 255, 'Cultivated Terrestrial\n Vegetated: Woody'), 3: (209, 224, 51, 255, 'Cultivated Terrestrial\n Vegetated: Herbaceous'), 4: (197, 168, 71, 255, 'Cultivated Terrestrial\n Vegetated: Closed\n (> 65 %)'), 5: (205, 181, 75, 255, 'Cultivated Terrestrial\n Vegetated: Open\n (40 to 65 %)'), 6: (213, 193, 79, 255, 'Cultivated Terrestrial\n Vegetated: Open\n (15 to 40 %)'), 7: (228, 210, 108, 255, 'Cultivated Terrestrial\n Vegetated: Sparse\n (4 to 15 %)'), 8: (242, 227, 138, 255, 'Cultivated Terrestrial\n Vegetated: Scattered\n (1 to 4 %)'), 9: (197, 168, 71, 255, 'Cultivated Terrestrial\n Vegetated: Woody Closed\n (> 65 %)'), 10: (205, 181, 75, 255, 'Cultivated Terrestrial\n Vegetated: Woody Open\n (40 to 65 %)'), 11: (213, 193, 79, 255, 'Cultivated Terrestrial\n Vegetated: Woody Open\n (15 to 40 %)'), 12: (228, 210, 108, 255, 'Cultivated Terrestrial\n Vegetated: Woody Sparse\n (4 to 15 %)'), 13: (242, 227, 138, 255, 'Cultivated Terrestrial\n Vegetated: Woody Scattered\n (1 to 4 %)'), 14: (228, 224, 52, 255, 'Cultivated Terrestrial\n Vegetated: Herbaceous Closed\n (> 65 %)'), 15: (235, 232, 84, 255, 'Cultivated Terrestrial\n Vegetated: Herbaceous Open\n (40 to 65 %)'), 16: (242, 240, 127, 255, 'Cultivated Terrestrial\n Vegetated: Herbaceous Open\n (15 to 40 %)'), 17: (249, 247, 174, 255, 'Cultivated Terrestrial\n Vegetated: Herbaceous Sparse\n (4 to 15 %)'), 18: (255, 254, 222, 255, 'Cultivated Terrestrial\n Vegetated: Herbaceous Scattered\n (1 to 4 %)'), 19: (14, 121, 18, 255, 'Natural Terrestrial Vegetated:'), 20: (26, 177, 87, 255, 'Natural Terrestrial Vegetated: Woody'), 21: (94, 179, 31, 255, 'Natural Terrestrial Vegetated: Herbaceous'), 22: (14, 121, 18, 255, 'Natural Terrestrial Vegetated: Closed (> 65 %)'), 23: (45, 141, 47, 255, 'Natural Terrestrial Vegetated: Open (40 to 65 %)'), 24: (80, 160, 82, 255, 'Natural Terrestrial Vegetated: Open (15 to 40 %)'), 25: (117, 180, 118, 255, 'Natural Terrestrial Vegetated: Sparse (4 to 15 %)'), 26: (154, 199, 156, 255, 'Natural Terrestrial Vegetated: Scattered (1 to 4 %)'), 27: (14, 121, 18, 255, 'Natural Terrestrial Vegetated: Woody Closed (> 65 %)'), 28: (45, 141, 47, 255, 'Natural Terrestrial Vegetated: Woody Open (40 to 65 %)'), 29: (80, 160, 82, 255, 'Natural Terrestrial Vegetated: Woody Open (15 to 40 %)'), 30: (117, 180, 118, 255, 'Natural Terrestrial Vegetated: Woody Sparse (4 to 15 %)'), 31: (154, 199, 156, 255, 'Natural Terrestrial Vegetated: Woody Scattered (1 to 4 %)'), 32: (119, 167, 30, 255, 'Natural Terrestrial Vegetated: Herbaceous Closed (> 65 %)'), 33: (136, 182, 51, 255, 'Natural Terrestrial Vegetated: Herbaceous Open (40 to 65 %)'), 34: (153, 196, 80, 255, 'Natural Terrestrial Vegetated: Herbaceous Open (15 to 40 %)'), 35: (170, 212, 113, 255, 'Natural Terrestrial Vegetated: Herbaceous Sparse (4 to 15 %)'), 36: (186, 226, 146, 255, 'Natural Terrestrial Vegetated: Herbaceous Scattered (1 to 4 %)'), 37: (86, 236, 231, 255, 'Cultivated Aquatic Vegetated:'), 38: (61, 170, 140, 255, 'Cultivated Aquatic Vegetated: Woody'), 39: (82, 231, 172, 255, 'Cultivated Aquatic Vegetated: Herbaceous'), 40: (43, 210, 203, 255, 'Cultivated Aquatic Vegetated: Closed (> 65 %)'), 41: (73, 222, 216, 255, 'Cultivated Aquatic Vegetated: Open (40 to 65 %)'), 42: (110, 233, 228, 255, 'Cultivated Aquatic Vegetated: Open (15 to 40 %)'), 43: (149, 244, 240, 255, 'Cultivated Aquatic Vegetated: Sparse (4 to 15 %)'), 44: (187, 255, 252, 255, 'Cultivated Aquatic Vegetated: Scattered (1 to 4 %)'), 50: (82, 231, 196, 255, 'Cultivated Aquatic Vegetated: Herbaceous Closed (> 65 %)'), 51: (113, 237, 208, 255, 'Cultivated Aquatic Vegetated: Herbaceous Open (40 to 65 %)'), 52: (144, 243, 220, 255, 'Cultivated Aquatic Vegetated: Herbaceous Open (15 to 40 %)'), 53: (175, 249, 232, 255, 'Cultivated Aquatic Vegetated: Herbaceous Sparse (4 to 15 %)'), 54: (207, 255, 244, 255, 'Cultivated Aquatic Vegetated: Herbaceous Scattered (1 to 4 %)'), 55: (30, 191, 121, 255, 'Natural Aquatic Vegetated:'), 56: (18, 142, 148, 255, 'Natural Aquatic Vegetated: Woody'), 57: (112, 234, 134, 255, 'Natural Aquatic Vegetated: Herbaceous'), 58: (25, 173, 109, 255, 'Natural Aquatic Vegetated: Closed (> 65 %)'), 59: (53, 184, 132, 255, 'Natural Aquatic Vegetated: Open (40 to 65 %)'), 60: (93, 195, 155, 255, 'Natural Aquatic Vegetated: Open (15 to 40 %)'), 61: (135, 206, 178, 255, 'Natural Aquatic Vegetated: Sparse (4 to 15 %)'), 62: (176, 218, 201, 255, 'Natural Aquatic Vegetated: Scattered (1 to 4 %)'), 63: (25, 173, 109, 255, 'Natural Aquatic Vegetated: Woody Closed (> 65 %)'), 64: (25, 173, 109, 255, 'Natural Aquatic Vegetated: Woody Closed (> 65 %) Water > 3 months (semi-) permanent'), 65: (25, 173, 109, 255, 'Natural Aquatic Vegetated: Woody Closed (> 65 %) Water < 3 months (temporary or seasonal)'), 66: (53, 184, 132, 255, 'Natural Aquatic Vegetated: Woody Open (40 to 65 %)'), 67: (53, 184, 132, 255, 'Natural Aquatic Vegetated: Woody Open (40 to 65 %) Water > 3 months (semi-) permanent'), 68: (53, 184, 132, 255, 'Natural Aquatic Vegetated: Woody Open (40 to 65 %) Water < 3 months (temporary or seasonal)'), 69: (93, 195, 155, 255, 'Natural Aquatic Vegetated: Woody Open (15 to 40 %)'), 70: (93, 195, 155, 255, 'Natural Aquatic Vegetated: Woody Open (15 to 40 %) Water > 3 months (semi-) permanent'), 71: (93, 195, 155, 255, 'Natural Aquatic Vegetated: Woody Open (15 to 40 %) Water < 3 months (temporary or seasonal)'), 72: (135, 206, 178, 255, 'Natural Aquatic Vegetated: Woody Sparse (4 to 15 %)'), 73: (135, 206, 178, 255, 'Natural Aquatic Vegetated: Woody Sparse (4 to 15 %) Water > 3 months (semi-) permanent'), 74: (135, 206, 178, 255, 'Natural Aquatic Vegetated: Woody Sparse (4 to 15 %) Water < 3 months (temporary or seasonal)'), 75: (176, 218, 201, 255, 'Natural Aquatic Vegetated: Woody Scattered (1 to 4 %)'), 76: (176, 218, 201, 255, 'Natural Aquatic Vegetated: Woody Scattered (1 to 4 %) Water > 3 months (semi-) permanent'), 77: (176, 218, 201, 255, 'Natural Aquatic Vegetated: Woody Scattered (1 to 4 %) Water < 3 months (temporary or seasonal)'), 78: (39, 204, 139, 255, 'Natural Aquatic Vegetated: Herbaceous Closed (> 65 %)'), 79: (39, 204, 139, 255, 'Natural Aquatic Vegetated: Herbaceous Closed (> 65 %) Water > 3 months (semi-) permanent'), 80: (39, 204, 139, 255, 'Natural Aquatic Vegetated: Herbaceous Closed (> 65 %) Water < 3 months (temporary or seasonal)'), 81: (66, 216, 159, 255, 'Natural Aquatic Vegetated: Herbaceous Open (40 to 65 %)'), 82: (66, 216, 159, 255, 'Natural Aquatic Vegetated: Herbaceous Open (40 to 65 %) Water > 3 months (semi-) permanent'), 83: (66, 216, 159, 255, 'Natural Aquatic Vegetated: Herbaceous Open (40 to 65 %) Water < 3 months (temporary or seasonal)'), 84: (99, 227, 180, 255, 'Natural Aquatic Vegetated: Herbaceous Open (15 to 40 %)'), 85: (99, 227, 180, 255, 'Natural Aquatic Vegetated: Herbaceous Open (15 to 40 %) Water > 3 months (semi-) permanent'), 86: (99, 227, 180, 255, 'Natural Aquatic Vegetated: Herbaceous Open (15 to 40 %) Water < 3 months (temporary or seasonal)'), 87: (135, 239, 201, 255, 'Natural Aquatic Vegetated: Herbaceous Sparse (4 to 15 %)'), 88: (135, 239, 201, 255, 'Natural Aquatic Vegetated: Herbaceous Sparse (4 to 15 %) Water > 3 months (semi-) permanent'), 89: (135, 239, 201, 255, 'Natural Aquatic Vegetated: Herbaceous Sparse (4 to 15 %) Water < 3 months (temporary or seasonal)'), 90: (171, 250, 221, 255, 'Natural Aquatic Vegetated: Herbaceous Scattered (1 to 4 %)'), 91: (171, 250, 221, 255, 'Natural Aquatic Vegetated: Herbaceous Scattered (1 to 4 %) Water > 3 months (semi-) permanent'), 92: (171, 250, 221, 255, 'Natural Aquatic Vegetated: Herbaceous Scattered (1 to 4 %) Water < 3 months (temporary or seasonal)'), 93: (218, 92, 105, 255, 'Artificial Surface:'), 94: (243, 171, 105, 255, 'Natural Surface:'), 95: (255, 230, 140, 255, 'Natural Surface: Sparsely vegetated'), 96: (250, 210, 110, 255, 'Natural Surface: Very sparsely vegetated'), 97: (243, 171, 105, 255, 'Natural Surface: Bare areas, unvegetated'), 98: (77, 159, 220, 255, 'Water:'), 99: (77, 159, 220, 255, 'Water: (Water)'), 100: (187, 220, 233, 255, 'Water: (Water) Tidal area'), 101: (27, 85, 186, 255, 'Water: (Water) Perennial (> 9 months)'), 102: (52, 121, 201, 255, 'Water: (Water) Non-perennial (7 to 9 months)'), 103: (79, 157, 217, 255, 'Water: (Water) Non-perennial (4 to 6 months)'), 104: (133, 202, 253, 255, 'Water: (Water) Non-perennial (1 to 3 months)'), 255: (255, 255, 255, 255, 'No Data')}, 'level4_colourbar_labels': {9: (197, 168, 71, 255, 'Cultivated Terrestrial Vegetated: Woody Closed (> 65 %)'), 10: (205, 181, 75, 255, 'Cultivated Terrestrial Vegetated: Woody Open (40 to 65 %)'), 11: (213, 193, 79, 255, 'Cultivated Terrestrial Vegetated: Woody Open (15 to 40 %)'), 12: (228, 210, 108, 255, 'Cultivated Terrestrial Vegetated: Woody Sparse (4 to 15 %)'), 13: (242, 227, 138, 255, 'Cultivated Terrestrial Vegetated: Woody Scattered (1 to 4 %)'), 14: (228, 224, 52, 255, 'Cultivated Terrestrial Vegetated: Herbaceous Closed (> 65 %)'), 15: (235, 232, 84, 255, 'Cultivated Terrestrial Vegetated: Herbaceous Open (40 to 65 %)'), 16: (242, 240, 127, 255, 'Cultivated Terrestrial Vegetated: Herbaceous Open (15 to 40 %)'), 17: (249, 247, 174, 255, 'Cultivated Terrestrial Vegetated: Herbaceous Sparse (4 to 15 %)'), 18: (255, 254, 222, 255, 'Cultivated Terrestrial Vegetated: Herbaceous Scattered (1 to 4 %)'), 27: (14, 121, 18, 255, 'Natural Terrestrial Vegetated: Woody Closed (> 65 %)'), 28: (45, 141, 47, 255, 'Natural Terrestrial Vegetated: Woody Open (40 to 65 %)'), 29: (80, 160, 82, 255, 'Natural Terrestrial Vegetated: Woody Open (15 to 40 %)'), 30: (117, 180, 118, 255, 'Natural Terrestrial Vegetated: Woody Sparse (4 to 15 %)'), 31: (154, 199, 156, 255, 'Natural Terrestrial Vegetated: Woody Scattered (1 to 4 %)'), 32: (119, 167, 30, 255, 'Natural Terrestrial Vegetated: Herbaceous Closed (> 65 %)'), 33: (136, 182, 51, 255, 'Natural Terrestrial Vegetated: Herbaceous Open (40 to 65 %)'), 34: (153, 196, 80, 255, 'Natural Terrestrial Vegetated: Herbaceous Open (15 to 40 %)'), 35: (170, 212, 113, 255, 'Natural Terrestrial Vegetated: Herbaceous Sparse (4 to 15 %)'), 36: (186, 226, 146, 255, 'Natural Terrestrial Vegetated: Herbaceous Scattered (1 to 4 %)'), 65: (25, 173, 109, 255, 'Natural Aquatic Vegetated: Woody Closed (> 65 %)'), 68: (53, 184, 132, 255, 'Natural Aquatic Vegetated: Woody Open (40 to 65 %)'), 71: (93, 195, 155, 255, 'Natural Aquatic Vegetated: Woody Open (15 to 40 %)'), 74: (135, 206, 178, 255, 'Natural Aquatic Vegetated: Woody Sparse (4 to 15 %)'), 77: (176, 218, 201, 255, 'Natural Aquatic Vegetated: Woody Scattered (1 to 4 %)'), 80: (39, 204, 139, 255, 'Natural Aquatic Vegetated: Herbaceous Closed (> 65 %)'), 83: (66, 216, 159, 255, 'Natural Aquatic Vegetated: Herbaceous Open (40 to 65 %)'), 86: (99, 227, 180, 255, 'Natural Aquatic Vegetated: Herbaceous Open (15 to 40 %)'), 89: (135, 239, 201, 255, 'Natural Aquatic Vegetated: Herbaceous Sparse (4 to 15 %)'), 92: (171, 250, 221, 255, 'Natural Aquatic Vegetated: Herbaceous Scattered (1 to 4 %)'), 93: (218, 92, 105, 255, 'Artificial Surface'), 95: (255, 230, 140, 255, 'Natural Surface: Sparsely vegetated'), 96: (250, 210, 110, 255, 'Natural Surface: Very sparsely vegetated'), 97: (243, 171, 105, 255, 'Natural Surface: Bare areas, unvegetated'), 100: (187, 220, 233, 255, 'Water: (Water) Tidal area'), 101: (27, 85, 186, 255, 'Water: (Water) Perennial (> 9 months)'), 102: (52, 121, 201, 255, 'Water: (Water) Non-perennial (7 to 9 months)'), 103: (79, 157, 217, 255, 'Water: (Water) Non-perennial (4 to 6 months)'), 104: (133, 202, 253, 255, 'Water: (Water) Non-perennial (1 to 3 months)'), 255: (255, 255, 255, 255, 'No Data')}})[source]

Returns the name of the Land Cover class given its value.

Parameters:
  • lc_value (int) – Value of a landcover class.

  • level (str) – Either ‘level3’ or ‘level4’.

  • lc_dictionary (dict, optional) – A dictionary specifying color schemes. Defaults to a nested dictionary with keys level3 and level4, each mapping to their respective sub-dictionaries.

Return type:

a string indicating the name of the land cover class

dea_tools.landcover.lc_animation(da, file_name='default_animation', measurement=None, stacked_plot=False, colour_bar=False, animation_interval=500, width_pixels=500, dpi=150, font_size=15, label_size=15, label_ax=True)[source]

Creates an animation of DEA Landcover though time beside corresponding stacked plots of the landcover classes. Saves the animation to a file and displays the animation in notebook.

Parameters:
  • da (xarray.DataArray) – An xarray.DataArray containing a multi-date stack of observations of a single landcover level.

  • file_name (string, optional.) – string used to create filename for saved animation file. Default: “default_animation” code adds .gif suffix.

  • measurement (string, optional) – Name of the DEA land cover classification to be plotted. Passed to _legend_colourmap to specify which colour scheme will be used. If non provided, reads data array name from da to determine.

  • stacked_plot (boolean, optional) – Determines if a stacked plot showing the percentage of area taken up by each class in each time slice is added to the animation. Default: False.

  • colour_bar (boolean, optional) – Determines if a colour bar is generated for the stand alone animation. This is NOT recommended for use with level 4 data. Does not work with stacked plot. Default: False.

  • animation_interval (int , optional) – How quickly the frames of the animations should be re-drawn. Default: 500.

  • width_pixels (int, optional) – An integer defining the output width in pixels for the resulting animation. The height of the animation is set automatically based on the dimensions/ratio of the input xarray dataset. Defaults to 500 pixels wide.

  • dpi (int, optional) – Stands for ‘Dots Per Inch’. Passed to the fuction that saves the animation and determines the resolution. A higher number will produce a higher resolution image but a larger file size and slower processing. Default: 150.

  • font_size (int, optional) – Controls the size of the text on the axes and colour bar. Default: 15.

  • label_size (int, optional.) – Controls the size of the text which indicates the year displayed. Default: 15.

  • label_ax (boolean, optional) – Determines if animation plot should have tick marks and numbers on axes. Also removes white space around plot. Default: True

Return type:

A GIF (.gif) animation file.

dea_tools.landcover.lc_colourmap(colour_scheme)[source]

Takes a colour scheme dictionary and returns colormap for matplotlib.

Returns:

  • cmap (matplotlib colormap) – Matplotlib colormap containing the colour scheme for the specified DEA Land Cover measurement.

  • norm (matplotlib colormap index) – Matplotlib colormap index based on the discrete intervals of the classes in the specified DEA Land Cover measurement. Ensures the colormap maps the colours to the class numbers correctly.

dea_tools.landcover.make_colourbar(fig, ax, measurement, labelsize=10, horizontal=False, animation=False)[source]

Adds a new colourbar with appropriate Land Cover colours and labels.

For DEA Land Cover Level 4 data, this function must be used with a double plot. The ‘ax’ should be on the left side of the figure, and the colour bar will added on the right hand side.

Parameters:
  • fig (matplotlib figure) – Figure to add colourbar to

  • ax (matplotlib ax) – Matplotlib figure ax to add colorbar to.

  • measurement (string) – Name of the layer or descriptor of interest.

  • labelsize (int, optional) – Size of labels in the colourbar.

  • horizontal (bool, optional) – If True, displays the colourbar horizontally; otherwise, uses vertical orientation.

  • animation (bool, optional) – If True, adjusts layout and axis size for animation display.

Return type:

Matplotlib colorbar in its own colour axis

dea_tools.landcover.plot_land_cover(data, labelsize=10, year=None, measurement=None, width_pixels=500, cols=4)[source]

Plot a single land cover measurement with appropriate colour scheme.

Parameters:
  • data (xarray.DataArray) – A dataArray containing a DEA Land Cover classification.

  • labelsize (int, optional) – Font size for the labels on the colourbar.

  • year (int, optional) – Can be used to select to plot a specific year. If not provided, all time slices are plotted.

  • measurement (string, optional) – Name of the DEA land cover classification to be plotted. Passed to _legend_colourmap to specify which colour scheme will be used. If non provided, reads data array name from da to determine.

  • width_pixels (int, optional) – An integer defining the output width in pixels for the resulting animation. The height of the animation is set automatically based on the dimensions/ratio of the input xarray dataset. Defaults to 500 pixels wide.

  • cols (integer, optional) – Sets number of columns if multiple time steps are visualised.

Return type:

Matplotlib image.