8000 bar / hist : gap between first bar and other bars with lw=0.0 · Issue #4602 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
bar / hist : gap between first bar and other bars with lw=0.0 #4602
Closed
@damiendr

Description

@damiendr

I like to make solid bar plots without lines around each bar, eg:

plt.hist(data, fc="gray", lw=0.0, alpha=0.5)

Problem: the first bar does not exactly line up with the other bars. There is a slight misalignment visible on the right and bottom edges. Depending on the window size this shows either as a white gap or a darker overlap (visible because alpha=0.5).

The other bars are all properly lined up.

Confirmed both in the notebook inline mode and the QT backend on OSX.
matplotlib.__version__ = '1.4.3'

Steps to reproduce:

import matplotlib.pylab as plt
import numpy as np
plt.figure()
plt.hist(np.random.uniform(0.0, 1.0, size=1000), fc="gray", lw=0.0, alpha=0.5)
plt.show()

Then resize the window and observe.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0