Skip to content

AttributeError: 'Legend' object has no attribute '_ncol'. Did you mean: '_ncols'? #582

Open
@aiodfy

Description

@aiodfy

When attempting to use Legends, the following error is presented.

AttributeError: 'Legend' object has no attribute '_ncol'. Did you mean: '_ncols'?

I quick search of the matplotlib docs showed that

The number of columns that the legend has.
For backward compatibility, the spelling ncol is also supported but it is discouraged. If both are given, ncols takes precedence

The Fix

_legends.py (Line 81)
Change
if obj._ncol != 1: data["current axes"].axis_options.append(f"legend columns={obj._ncol}")
to
if obj._ncols != 1: data["current axes"].axis_options.append(f"legend columns={obj._ncols}")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions