Skip to content

Instantly share code, notes, and snippets.

@pmarshwx
Created July 11, 2012 04:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pmarshwx/3087990 to your computer and use it in GitHub Desktop.
Save pmarshwx/3087990 to your computer and use it in GitHub Desktop.
A self-contained example script to highlight the quadmesh bug on OSX using MacOSX backend
import numpy as np
import matplotlib.pyplot as plt
a = np.arange(10)
grid = np.outer(a, a)
plt.pcolormesh(grid)
plt.show()
Commit: 8c57e4fe4909815092af470f4a036c80b407382c
Traceback (most recent call last):
File "/Users/pmarsh/.local/lib/python2.7/site-packages/matplotlib/artist.py", line 55, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "/Users/pmarsh/.local/lib/python2.7/site-packages/matplotlib/figure.py", line 927, in draw
func(*args)
File "/Users/pmarsh/.local/lib/python2.7/site-packages/matplotlib/artist.py", line 55, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "/Users/pmarsh/.local/lib/python2.7/site-packages/matplotlib/axes.py", line 1998, in draw
a.draw(renderer)
File "/Users/pmarsh/.local/lib/python2.7/site-packages/matplotlib/artist.py", line 55, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "/Users/pmarsh/.local/lib/python2.7/site-packages/matplotlib/collections.py", line 1451, in draw
self._antialiased, self.get_edgecolors())
File "/Users/pmarsh/.local/lib/python2.7/site-packages/matplotlib/backends/backend_macosx.py", line 101, in draw_quad_mesh
showedges)
TypeError: only length-1 arrays can be converted to Python scalars
@MadDataScience
Copy link

I'm getting the same error. Any word on what to do about it?

@pmarshwx
Copy link
Author

There isn't a current fix right now. The creator of the MacOSX backend is aware of the bug and is working on a solution. Latest estimate I've heard is that it could be a week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment