Skip to content

'stepfilled' histogram is not filled properly when setting yscale('log') #1727

Closed

Description

@gitcheng

I am using 1.3.x that I just cloned today. The histogram is not filled properly in log scale if I set yscale('log'). However, if I use hist(..., log=True), it looks fine.

import matplotlib.pyplot as plt
import numpy as np
x= np.arange(10)
plt.subplot(211)
plt.yscale('log')
plt.hist(x, weights=x, histtype='stepfilled')
plt.title('Use yscale(\'log\')')
plt.subplot(212)
plt.hist(x, weights=x, histtype='stepfilled', log=True)
plt.title('Use hist(..., log=True)')
plt.show()

stepfilled_log

Activity

  1. neggert commented on Feb 1, 2013

    @neggert
    Contributor

    This has been around for a while. I've been working around it by doing.

    ax.set_yscale('log', nonposy='clip')
    

    Then you can call hist normally.

  2. neggert commented on Mar 1, 2013

    @neggert
    Contributor

    This should be fixed in v1.2.x, now that #1724 has been merged.

  3. dmcdougall commented on Mar 23, 2013

    @dmcdougall
    Member

    Thanks @neggert, closing.

    @gitcheng If in fact the problem persists, please feel free to re-open this ticket and we can investigate further. Thanks for the bug report!

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

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