Skip to content

[Bug]: when using histtype, linestyle is not carried through to plot #29955

Closed as duplicate
@joemasiero

Description

@joemasiero

Bug summary

Prior to the current matplotlib version, when using histtype='step' in pyplot.hist you could customize the linestyle with that command. Now, linestyle is not being used and all lines are coming out as 'solid'

Code for reproduction

import matplotlib.pyplot as plt
dat=[0,1,2,3,4,5,2,3,4,5,4,5,5]
plt.figure()
plt.hist(dat,bins=3,ls='solid',color='k',histtype='step')
plt.show()
plt.figure()
plt.hist(dat,bins=3,ls='dotted',color='k',histtype='step')
plt.show()

Actual outcome

two plots, both showing the same graphic

Expected outcome

the second plot should have a dotted line, not a solid line

Additional information

No response

Operating system

OS/X

Matplotlib Version

3.10.0

Matplotlib Backend

macosx

Python version

Python 3.11.9

Jupyter version

n/a

Installation

pip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions