Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

plt.hist() fails with TensorFlow Numpy emulation #19574

Open
@FlorinAndrei

Description

@FlorinAndrei

Bug report

Bug summary

Generatingnp.random.randn(1000) values, visualizing them withplt.hist(). Works fine with Numpy.

When I replace Numpy with tensorflow.experimental.numpy, Matplotlib 3.3.4 fails to display the histogram correctly. Matplotlib 3.2.2 works fine.

Code for reproduction

importmatplotlib.pyplotaspltimportnumpyasnpimporttensorflowastfimporttensorflow.experimental.numpyastnp# bad imagelabels1=15+2*tnp.random.randn(1000)_=plt.hist(labels1)# good imagelabels2=15+2*np.random.randn(1000)_=plt.hist(labels2)

Actual outcome

np-bad

Expected outcome

np-good

Matplotlib version

  • Operating system: Windows 10
  • Matplotlib version (import matplotlib; print(matplotlib.__version__)): 3.3.4
  • Matplotlib backend (print(matplotlib.get_backend())): module://ipykernel.pylab.backend_inline
  • Python version: 3.8.7
  • Jupyter version (if applicable): see below
  • Other libraries: see below

TensorFlow 2.4.1

jupyter --versionjupyter core     : 4.7.0jupyter-notebook : 6.1.6qtconsole        : 5.0.1ipython          : 7.20.0ipykernel        : 5.4.2jupyter client   : 6.1.7jupyter lab      : not installednbconvert        : 6.0.7ipywidgets       : 7.6.3nbformat         : 5.0.8traitlets        : 5.0.5

Python installed from python.org as an exe installer. Everything else ispip install --user

Bug opened with TensorFlow on this same issue:

tensorflow/tensorflow#46274

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp