TypeError: boxplot() got an unexpected keyword argument 'labels'

11,785

Solution 1

The labels kwarg was added in https://github.com/matplotlib/matplotlib/pull/2643, first shipped with mpl v1.4.0 and is still present on master.

Solution 2

The solution did not work for me (Python 33 on Windows). I found another way and leave it here just in case someone else may need it:

  1. Uninstall the old version: pip uninstall matplotlib
  2. Download the wheel file from here https://pypi.python.org/pypi/matplotlib/1.4.3
  3. Run pip install path_to_whl_file
Share:
11,785
MRule
Author by

MRule

Updated on June 13, 2022

Comments

  • MRule
    MRule almost 2 years

    I'm using ipython 3.2.0, and I'm trying to use boxplot. Online documentation and examples suggest that a keyword "labels" should exist, as also stated in this SO post, but I get the following error:

    TypeError: boxplot() got an unexpected keyword argument 'labels'
    

    Was the labels keyword removed? If so, what is the official way to get a legend for a boxplot?