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

Skip to content

hist reverses legend order if histtype is not bar #8461

Open
@efiring

Description

@efiring

Matplotlib v2.0.x and master on Python 3.5:

x1 = np.random.randn(100)
x2 = np.random.rand(100)
plt.hist([x1, x2], label=['x1', 'x2'], histtype='step')
plt.legend()

Actual outcome
hist_reversed_order

Expected outcome

With histtype='bar' the order of the variables is preserved, as I would expect, instead of reversed, as with step.

Metadata

Metadata

Assignees

No one assigned

    Labels

    keepItems to be ignored by the “Stale” Github Actiontopic: hist

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions