Skip to content

hist(..., histtype='step') does not set ylim properly. #2061

Closed
@tkf

Description

@tkf

Checked with the latest version from master (d5071f4).

import numpy
import pylab

x = numpy.array(
      [ 94,  95,  96,  98,  84, 104,  99,  88,  80,  90,  99,  95,  89,
        88,  94,  99,  99,  91, 100,  86, 102,  85,  84,  95,  87,  87,
       106, 109,  97,  97, 106,  93,  90,  91,  95,  93,  81,  93, 103,
        82,  94,  89, 113,  93,  95, 103,  99,  99,  93, 103,  87,  94,
        96, 104,  88,  98,  89, 117,  88,  87,  97,  91,  84,  90,  98,
        90, 100,  92, 102,  89, 104, 104,  92,  96,  88,  97, 105, 106,
       104, 105,  88,  93, 112,  82, 102,  81,  80,  86, 100, 101,  93,
        93,  91,  99,  90, 100,  93,  96,  99,  99])
pylab.hist(x, histtype='step')
pylab.savefig('fig.png')

fig

It failed to show the lower y values. If you set ymin=0, you can see it:

pylab.ylim(ymin=0)
pylab.savefig('fig2.png')

fig2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions