Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Axes.bar: wrong default parameter in documentation #5316

@Kojoley

Description

@Kojoley

I have to open pull request, but couldn't decide what is preferred to fix . Logically vertical is right for default value, but altering API isn't good for code that relies on it.

From lib/matplotlib/axes/_axes.py:

    def barh(self, bottom, width, height=0.8, left=None, **kwargs):
        """
        Make a horizontal bar plot.
        ...
        orientation : 'vertical' | 'horizontal', optional, default: 'vertical'
            The orientation of the bars.
        ...
        """

        patches = self.bar(left=left, height=height, width=width,
                           bottom=bottom, orientation='horizontal', **kwargs)
        return patches

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions