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

Skip to content

imshow longdouble not truly supported #10342

Closed
@QuLogic

Description

@QuLogic

Bug report

Support for longdouble was theoretically added in #8447. There is also code to test it out; unfortunately, it doesn't actually attempt to draw anything. Adding the draw causes it to crash.

Code for reproduction

import matplotlib.pyplot as plt
import numpy as np

fig, ax = plt.subplots()
ax.imshow(np.zeros((3, 3), dtype=np.longdouble))

fig.canvas.draw()

Actual outcome

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/elliott/code/matplotlib/lib/matplotlib/backends/backend_tkagg.py", line 299, in draw
    FigureCanvasAgg.draw(self)
  File "/home/elliott/code/matplotlib/lib/matplotlib/backends/backend_agg.py", line 432, in draw
    self.figure.draw(self.renderer)
  File "/home/elliott/code/matplotlib/lib/matplotlib/artist.py", line 55, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)
  File "/home/elliott/code/matplotlib/lib/matplotlib/figure.py", line 1337, in draw
    renderer, self, artists, self.suppressComposite)
  File "/home/elliott/code/matplotlib/lib/matplotlib/image.py", line 138, in _draw_list_compositing_images
    a.draw(renderer)
  File "/home/elliott/code/matplotlib/lib/matplotlib/artist.py", line 55, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)
  File "/home/elliott/code/matplotlib/lib/matplotlib/axes/_base.py", line 2560, in draw
    mimage._draw_list_compositing_images(renderer, self, artists)
  File "/home/elliott/code/matplotlib/lib/matplotlib/image.py", line 138, in _draw_list_compositing_images
    a.draw(renderer)
  File "/home/elliott/code/matplotlib/lib/matplotlib/artist.py", line 55, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)
  File "/home/elliott/code/matplotlib/lib/matplotlib/image.py", line 568, in draw
    renderer, renderer.get_image_magnification())
  File "/home/elliott/code/matplotlib/lib/matplotlib/image.py", line 795, in make_image
    unsampled=unsampled)
  File "/home/elliott/code/matplotlib/lib/matplotlib/image.py", line 413, in _make_image
    self.get_filterrad() or 0.0)
ValueError: Unsupported dtype

Matplotlib version

  • Operating system: Fedora
  • Matplotlib version: 2.1.0 & master
  • Matplotlib backend (print(matplotlib.get_backend())): TkAgg
  • Python version: 3.6
  • Jupyter version (if applicable):
  • Other libraries:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions