Skip to content

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

Closed as duplicate

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

Activity

  1. jklymak commented on Apr 21, 2025

    @jklymak
    Member

    This was fixed by #29719 and will be available 3.10.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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