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

Skip to content

Bar plot seems not to understand numpy.uint8 dtype #4751

Closed
@chriswl

Description

@chriswl

When I do

from matplotlib import pyplot as plt
import numpy as np
plt.bar(np.array([0, 1, 2, 3], dtype=np.uint8), [2, 3, 4, 5])

I get an unexpected result -- the values for the bar centers are interpreted as [0, 257, 258, 259]. Similar things do not happen with plt.plot and plt.scatter. The environment is matplotlib v. 1.4.3, numpy v. 1.9.2. in an IPython notebook, IPython v. 3.2.

This is a screenshot of the above example after doing plt.gca().set_xlim([250, 260]).
screen shot 2015-07-21 at 20 40 22

Metadata

Metadata

Assignees

Labels

Release criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.status: confirmed bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions