Thanks to visit codestin.com
Credit goes to github.com

Skip to content

plt.bar() creates different results when repeated #13909

Closed as not planned
Closed as not planned
@tlkaufmann

Description

@tlkaufmann

Bug report

Bug summary

When plotting a bar graph of some data from np.histogram on several different axis the outcome always slightly differs from each other.

Code for reproduction

import numpy as np
import matplotlib.pyplot as plt

data = np.random.uniform(0, 100, size = 100)
hist, bins = np.histogram(data, bins=100)

fig, ax = plt.subplots(ncols = 3)

for a in ax:
    a.bar(bins[:-1], hist)

Actual outcome
pyplot_bar

Expected outcome

The same barplot three times.

Matplotlib version

  • Operating system: Ubuntu 18.04
  • Matplotlib version: 3.0.2
  • Matplotlib backend (print(matplotlib.get_backend())): module://ipykernel.pylab.backend_inline
  • Python version: 3.7.1
  • Jupyter version (if applicable): IPython 7.2.0

Matplotlib installed via standard conda channel.

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: closed as inactiveIssues closed by the "Stale" Github Action. Please comment on any you think should still be open.status: inactiveMarked by the “Stale” Github Action

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions