-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
MacOSX backend breaks for matplotlib 1.4 after importing seaborn #3470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Quoting @mwaskom
gives changed_params as
|
http://stackoverflow.com/questions/25865975/pylab-networkx-no-node-labels-displayed-after-update/25870916 has the same exception via plotting labels in networkx. Hopefully the intersection of those two code-bases will help narrow this down..... |
the rcparams from the above linked problem are
(actively) imported packages are matplotlib (1.4), matplotlib.pyplot and networkx (1.9) |
@xiaoweiz Can you check which of the arguments to get_text_width_height_descent is actually causing the problem? Just printing out the arguments and their type should give enough information. |
@mdehoon As a newbie, I'm not sure how this should done... |
@xiaoweiz print(six.text_type(s))
print(family)
print(size)
print(weight)
print(style) |
@mdehoon The outputs are lp
['sans-serif']
11.1111111111
normal
normal |
There is a minor change in the definition of the function In the 1.3.1 version, line 158 of width, height, descent = self.gc.get_text_width_height_descent(unicode(s), family, size, weight, style) whereas in 1.4.0 version, the first argument of the call is changed from However, changing the function call to the 1.3.1 version doesn't solve the original issue. |
Thank you. The problem turns out to be in the 'family' argument. family = prop.get_family() in line 160 of lib/matplotlib/backends/backend_macosx.py returns a list of Unicode strings. To avoid code duplication in the backends, I think the right solution is for prop.get_family() to always return a list of Unicode strings. |
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_91_maint ........ r5028 | jdh2358 | 2008-04-03 11:24:20 -0400 (Thu, 03 Apr 2008) | 1 line some small fixes to excel tools ........ r5032 | jrevans | 2008-04-07 18:26:21 -0400 (Mon, 07 Apr 2008) | 2 lines Fixed the double draw bug. ........ r5033 | jdh2358 | 2008-04-09 14:54:54 -0400 (Wed, 09 Apr 2008) | 1 line small fix for vlines w/ len 1 args ........ r5038 | mdboom | 2008-04-11 11:24:57 -0400 (Fri, 11 Apr 2008) | 3 lines Fixing global font rcParam setting after initialization time (thanks to Lev Givon and Eric Firing for finding this) ........ svn path=/trunk/matplotlib/; revision=5039
I suspect that is a problem with the fact that rcparams is not unicode-ified yet... The check should probably be done in |
👍 to @tacaswell's suggestion. |
@mwaskom On solution for this is to include a |
ok, so the actual problem is that I'll have a PR up before I go to bed, but it probably won't be done. |
Close matplotlib#3470 Over-ride `update` so that inputs are validated.
@tacaswell - it sounds like this might be a bug with seaborn (as well as us needing to fix the rcParam)? Is that the case? We should give heads up to the project if we are talking about being more strict with the RC params dictionary. |
The only thing that needed to be relaxed was to allow any thing with a length to be passed in for the We shouldn't be type on list and tuple like we were anyway. |
I've just found a similar issue. In In [1]: import pandas as pd
In [2]: import numpy as np
In [3]: ts = pd.Series(np.arange(10))
In [4]: pd.opt
pd.option_context pd.options
In [4]: pd.options.display.mpl_style = 'default'
In [5]: ts.plot()
Out[5]: <matplotlib.axes._subplots.AxesSubplot at 0x1101f1ed0>
In [6]: Traceback (most recent call last):
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/artist.py", line 59, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/figure.py", line 1079, in draw
func(*args)
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/artist.py", line 59, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/axes/_base.py", line 2092, in draw
a.draw(renderer)
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/artist.py", line 59, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/axis.py", line 1105, in draw
renderer)
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/axis.py", line 1054, in _get_tick_bboxes
extent = tick.label1.get_window_extent(renderer)
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/text.py", line 741, in get_window_extent
bbox, info, descent = self._get_layout(self._renderer)
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/text.py", line 311, in _get_layout
ismath=False)
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/backends/backend_macosx.py", line 166, in get_text_width_height_descent
six.text_type(s), family, size, weight, style)
TypeError: bad argument type for built-in operation
If you suspect this is an IPython bug, please report it at:
https://github.com/ipython/ipython/issues
or send an email to the mailing list at ipython-dev@scipy.org
You can print a more detailed traceback right now with "%tb", or use "%debug"
to interactively debug it.
Extra-detailed tracebacks for bug-reporting purposes can be enabled via:
%config Application.verbose_crash=True |
Hi There, |
@tacaswell There are various file changes in #3564 and I simply copied all the four files in https://github.com/matplotlib/matplotlib/pull/3564/files to override the current files in my Mac. It works! |
What failures? And why do you think they are unrelated? Can you please post the details over in the pr thread? |
I vaguely remember I run the test suite before I found out this current issue and had the same failure results. But my memory may be incorrect. Anyway, here is the test results. IPython 2.3.0 -- An enhanced Interactive Python.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://binstar.org
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
In [1]: import matplotlib as mpl
In [2]: mpl.test()
/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/cbook.py:133: MatplotlibDeprecationWarning: The matplotlib.delaunay module was deprecated in version 1.4. Use matplotlib.tri.Triangulation instead.
warnings.warn(message, mplDeprecation, stacklevel=1)
...KKKKKK./Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/bezier.py:298: DeprecationWarning: using a non-integer number instead of an integer will result in an error in the future
path_out = Path(concat([verts_right, path.vertices[i:]]),
/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/bezier.py:299: DeprecationWarning: using a non-integer number instead of an integer will result in an error in the future
concat([codes_right, path.codes[i:]]))
..K/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/hatch.py:209: DeprecationWarning: using a non-integer number instead of an integer will result in an error in the future
vertices = np.empty((num_vertices, 2))
/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/hatch.py:210: DeprecationWarning: using a non-integer number instead of an integer will result in an error in the future
codes = np.empty((num_vertices,), np.uint8)
/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/hatch.py:215: DeprecationWarning: using a non-integer number instead of an integer will result in an error in the future
vertices_chunk = vertices[cursor:cursor + pattern.num_vertices]
/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/hatch.py:216: DeprecationWarning: using a non-integer number instead of an integer will result in an error in the future
codes_chunk = codes[cursor:cursor + pattern.num_vertices]
..K.....K....K..K..K..K..K..K..K............................K..K..K..K....K..K..K..K..K..K..K...K..K..K..K..K..K....K..K..K..K..K..K..K..K..K..K.....K.........K..K..K......K..K..K..K..K..K/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/cbook.py:1744: DeprecationWarning: using a non-integer number instead of an integer will result in an error in the future
result = np.zeros(new_shape, a.dtype)
..K..K/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/projections/geo.py:489: RuntimeWarning: invalid value encountered in arcsin
theta = np.arcsin(y / np.sqrt(2))
..K/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/tests/test_axes.py:526: DeprecationWarning: using a non-integer number instead of an integer will result in an error in the future
x[len(x)/2] = np.nan
..K...K........K..K..K..K..K..K..K..K..K..K....K..K..K..K..............K..K..K..K..K..K..K....K.....................................K..........................K..K...K...K..K..K......................K..K..K..K..K..K..K..K..K..K..K..K..K.................................../Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/colors.py:1534: RuntimeWarning: invalid value encountered in true_divide
(intensity.max() - intensity.min())
/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/colors.py:1542: RuntimeWarning: invalid value encountered in greater
intensity > 0),
/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/colors.py:1547: RuntimeWarning: invalid value encountered in greater
hsv[:, :, 2] = np.where(intensity > 0,
/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/colors.py:1553: RuntimeWarning: invalid value encountered in less
intensity < 0),
/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/colors.py:1557: RuntimeWarning: invalid value encountered in less
hsv[:, :, 2] = np.where(intensity < 0,
......./Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/contour.py:488: DeprecationWarning: using a non-integer number instead of an integer will result in an error in the future
nlc.append(np.r_[lc[:I[0] + 1], xy1])
/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/contour.py:490: DeprecationWarning: using a non-integer number instead of an integer will result in an error in the future
nlc.append(np.r_[xy2, lc[I[1]:]])
..K./Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/contour.py:484: DeprecationWarning: using a non-integer number instead of an integer will result in an error in the future
nlc.append(np.r_[xy2, lc[I[1]:I[0] + 1], xy1])
/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/text.py:52: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
if rotation in ('horizontal', None):
/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/text.py:54: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
elif rotation == 'vertical':
......................................................................................K..K..K...........K..K..K..K..K.K..K.K..K.K..............K..K..K..K..K..K..K..K..K...K..........................................................................................................................................................................................K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K..K........................................................................................../Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/mlab.py:3727: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
elif bw_method == 'scott':
/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/mlab.py:3729: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
elif bw_method == 'silverman':
........./Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/tests/test_mlab.py:1331: DeprecationWarning: using a non-integer number instead of an integer will result in an error in the future
t_specgram = x[t_start:t_stop:t_step]
...................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................../Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/tri/triangulation.py:110: FutureWarning: comparison to `None` will result in an elementwise object comparison in the future.
self._neighbors)
/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/numpy/testing/utils.py:838: RuntimeWarning: invalid value encountered in less_equal
return around(z, decimal) <= 10.0**(-decimal)
.K..K..K..K..K........K..K..K..K..................................................................K...K..K..K..K..K..K..K..K..K../Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/tests/test_simplification.py:156: DeprecationWarning: using a non-integer number instead of an integer will result in an error in the future
verts = verts.reshape((len(verts) / 2, 2))
....K..K..K..K..K/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/numpy/ma/core.py:783: RuntimeWarning: invalid value encountered in greater_equal
return umath.absolute(a) * self.tolerance >= umath.absolute(b)
..K.......K./Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/pyplot.py:1064: UserWarning: sharex argument to subplots() was an integer. Did you intend to use subplot() (without 's')?
warnings.warn("sharex argument to subplots() was an integer."
......K..EFFK..K...........K..K..K..K..K/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/gridspec.py:302: UserWarning: This figure includes Axes that are not compatible with tight_layout, so its results might be incorrect.
warnings.warn("This figure includes Axes that are not "
..K..K..K.................K......../Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/tri/trirefine.py:236: DeprecationWarning: using a non-integer number instead of an integer will result in an error in the future
refi_x = np.zeros(refi_npts)
/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/tri/trirefine.py:237: DeprecationWarning: using a non-integer number instead of an integer will result in an error in the future
refi_y = np.zeros(refi_npts)
........./Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/tri/triangulation.py:212: FutureWarning: comparison to `None` will result in an elementwise object comparison in the future.
self._cpp_triangulation.set_mask(self.mask)
............K..K./Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/backends/backend_pdf.py:2264: FutureWarning: comparison to `None` will result in an elementwise object comparison in the future.
different = bool(ours != theirs)
.K..K..K..K..K..K..K..K..K..K..K
======================================================================
ERROR: test suite for <class 'matplotlib.tests.test_text.test_font_styles'>
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/nose/suite.py", line 209, in run
self.setUp()
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/nose/suite.py", line 292, in setUp
self.setupContext(ancestor)
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/nose/suite.py", line 315, in setupContext
try_run(context, names)
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/nose/util.py", line 470, in try_run
return func()
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/testing/decorators.py", line 134, in setup_class
cls._func()
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/tests/test_text.py", line 45, in test_font_styles
size=14,
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/tests/test_text.py", line 21, in find_matplotlib_font
path = findfont(prop, directory=data_path)
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/font_manager.py", line 1418, in findfont
font = fontManager.findfont(prop, **kw)
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/font_manager.py", line 1258, in findfont
os.path.commonprefix([font.fname, directory]) != directory):
File "/Users/zhangxiaowei/anaconda/lib/python2.7/genericpath.py", line 71, in commonprefix
s1 = min(m)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 15: ordinal not in range(128)
======================================================================
FAIL: matplotlib.tests.test_text.test_multiline.test
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/testing/decorators.py", line 51, in failer
result = f(*args, **kwargs)
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/testing/decorators.py", line 196, in do_test
'(RMS %(rms).3f)'%err)
ImageComparisonFailure: images not close: /Users/zhangxiaowei/Downloads/result_images/test_text/multiline.png vs. /Users/zhangxiaowei/Downloads/result_images/test_text/multiline-expected.png (RMS 27.663)
======================================================================
FAIL: matplotlib.tests.test_text.test_multiline.test
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/testing/decorators.py", line 51, in failer
result = f(*args, **kwargs)
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/testing/decorators.py", line 196, in do_test
'(RMS %(rms).3f)'%err)
ImageComparisonFailure: images not close: /Users/zhangxiaowei/Downloads/result_images/test_text/multiline_pdf.png vs. /Users/zhangxiaowei/Downloads/result_images/test_text/multiline-expected_pdf.png (RMS 35.875)
----------------------------------------------------------------------
Ran 4734 tests in 378.639s
FAILED (KNOWNFAIL=379, errors=1, failures=2)
/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/__init__.py:1287: UserWarning: This call to matplotlib.use() has no effect
because the backend has already been chosen;
matplotlib.use() must be called *before* pylab, matplotlib.pyplot,
or matplotlib.backends is imported for the first time.
warnings.warn(_use_error_msg)
Out[2]: False |
@tacaswell I reversed matplotlib back to 1.4.0 prior your patches, run the test suite again and got more errors and failures. Hmm... ======================================================================
ERROR: test suite for <class 'matplotlib.tests.test_axes.test_pcolor_datetime_axis'>
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/nose/suite.py", line 209, in run
self.setUp()
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/nose/suite.py", line 292, in setUp
self.setupContext(ancestor)
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/nose/suite.py", line 315, in setupContext
try_run(context, names)
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/nose/util.py", line 470, in try_run
return func()
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/testing/decorators.py", line 134, in setup_class
cls._func()
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/tests/test_axes.py", line 730, in test_pcolor_datetime_axis
plt.pcolor(x[:-1], y[:-1], z)
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/pyplot.py", line 3012, in pcolor
ret = ax.pcolor(*args, **kwargs)
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/axes/_axes.py", line 4944, in pcolor
collection = mcoll.PolyCollection(verts, **kwargs)
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/collections.py", line 801, in __init__
self.set_verts(verts, closed)
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/collections.py", line 821, in set_verts
self._paths.append(mpath.Path(xy, codes))
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/path.py", line 137, in __init__
vertices = np.asarray(vertices, np.float_)
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/numpy/core/numeric.py", line 462, in asarray
return array(a, dtype, copy=False, order=order)
TypeError: float() argument must be a string or a number
======================================================================
ERROR: test suite for <class 'matplotlib.tests.test_contour.test_contour_datetime_axis'>
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/nose/suite.py", line 209, in run
self.setUp()
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/nose/suite.py", line 292, in setUp
self.setupContext(ancestor)
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/nose/suite.py", line 315, in setupContext
try_run(context, names)
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/nose/util.py", line 470, in try_run
return func()
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/testing/decorators.py", line 134, in setup_class
cls._func()
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/tests/test_contour.py", line 212, in test_contour_datetime_axis
plt.contour(x, y, z)
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/pyplot.py", line 2694, in contour
ret = ax.contour(*args, **kwargs)
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/axes/_axes.py", line 5318, in contour
return mcontour.QuadContourSet(self, *args, **kwargs)
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/contour.py", line 1428, in __init__
ContourSet.__init__(self, ax, *args, **kwargs)
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/contour.py", line 874, in __init__
self._process_args(*args, **kwargs)
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/contour.py", line 1441, in _process_args
x, y, z = self._contour_args(args, kwargs)
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/contour.py", line 1505, in _contour_args
x, y, z = self._check_xyz(args[:3], kwargs)
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/contour.py", line 1534, in _check_xyz
x = np.asarray(x, dtype=np.float64)
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/numpy/core/numeric.py", line 462, in asarray
return array(a, dtype, copy=False, order=order)
TypeError: float() argument must be a string or a number
======================================================================
ERROR: matplotlib.tests.test_contour.test_contour_manual_labels.test
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/testing/decorators.py", line 51, in failer
result = f(*args, **kwargs)
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/testing/decorators.py", line 186, in do_test
self._tol, in_decorator=True)
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/testing/compare.py", line 326, in compare_images
rms = calculate_rms(expectedImage, actualImage)
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/testing/compare.py", line 246, in calculate_rms
abs_diff_image = abs(expectedImage - actualImage)
ValueError: operands could not be broadcast together with shapes (200,600,3) (600,800,3)
======================================================================
ERROR: matplotlib.tests.test_contour.test_contour_manual_labels.test
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/testing/decorators.py", line 51, in failer
result = f(*args, **kwargs)
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/testing/decorators.py", line 186, in do_test
self._tol, in_decorator=True)
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/testing/compare.py", line 326, in compare_images
rms = calculate_rms(expectedImage, actualImage)
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/testing/compare.py", line 246, in calculate_rms
abs_diff_image = abs(expectedImage - actualImage)
ValueError: operands could not be broadcast together with shapes (144,432,3) (432,576,3)
======================================================================
ERROR: test suite for <class 'matplotlib.tests.test_text.test_font_styles'>
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/nose/suite.py", line 209, in run
self.setUp()
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/nose/suite.py", line 292, in setUp
self.setupContext(ancestor)
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/nose/suite.py", line 315, in setupContext
try_run(context, names)
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/nose/util.py", line 470, in try_run
return func()
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/testing/decorators.py", line 134, in setup_class
cls._func()
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/tests/test_text.py", line 45, in test_font_styles
size=14,
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/tests/test_text.py", line 21, in find_matplotlib_font
path = findfont(prop, directory=data_path)
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/font_manager.py", line 1418, in findfont
font = fontManager.findfont(prop, **kw)
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/font_manager.py", line 1258, in findfont
os.path.commonprefix([font.fname, directory]) != directory):
File "/Users/zhangxiaowei/anaconda/lib/python2.7/genericpath.py", line 71, in commonprefix
s1 = min(m)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 15: ordinal not in range(128)
======================================================================
FAIL: matplotlib.tests.test_axes.test_pcolormesh.test
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/testing/decorators.py", line 51, in failer
result = f(*args, **kwargs)
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/testing/decorators.py", line 196, in do_test
'(RMS %(rms).3f)'%err)
ImageComparisonFailure: images not close: /Users/zhangxiaowei/Downloads/result_images/test_axes/pcolormesh.png vs. /Users/zhangxiaowei/Downloads/result_images/test_axes/pcolormesh-expected.png (RMS 94.858)
======================================================================
FAIL: matplotlib.tests.test_axes.test_pcolormesh.test
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/testing/decorators.py", line 51, in failer
result = f(*args, **kwargs)
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/testing/decorators.py", line 196, in do_test
'(RMS %(rms).3f)'%err)
ImageComparisonFailure: images not close: /Users/zhangxiaowei/Downloads/result_images/test_axes/pcolormesh_pdf.png vs. /Users/zhangxiaowei/Downloads/result_images/test_axes/pcolormesh-expected_pdf.png (RMS 92.037)
======================================================================
FAIL: matplotlib.tests.test_dates.test_DateFormatter.test
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/testing/decorators.py", line 51, in failer
result = f(*args, **kwargs)
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/testing/decorators.py", line 196, in do_test
'(RMS %(rms).3f)'%err)
ImageComparisonFailure: images not close: /Users/zhangxiaowei/Downloads/result_images/test_dates/DateFormatter_fractionalSeconds.png vs. /Users/zhangxiaowei/Downloads/result_images/test_dates/DateFormatter_fractionalSeconds-expected.png (RMS 16.865)
======================================================================
FAIL: matplotlib.tests.test_text.test_multiline.test
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/testing/decorators.py", line 51, in failer
result = f(*args, **kwargs)
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/testing/decorators.py", line 196, in do_test
'(RMS %(rms).3f)'%err)
ImageComparisonFailure: images not close: /Users/zhangxiaowei/Downloads/result_images/test_text/multiline.png vs. /Users/zhangxiaowei/Downloads/result_images/test_text/multiline-expected.png (RMS 27.663)
======================================================================
FAIL: matplotlib.tests.test_text.test_multiline.test
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/testing/decorators.py", line 51, in failer
result = f(*args, **kwargs)
File "/Users/zhangxiaowei/anaconda/lib/python2.7/site-packages/matplotlib/testing/decorators.py", line 196, in do_test
'(RMS %(rms).3f)'%err)
ImageComparisonFailure: images not close: /Users/zhangxiaowei/Downloads/result_images/test_text/multiline_pdf.png vs. /Users/zhangxiaowei/Downloads/result_images/test_text/multiline-expected_pdf.png (RMS 35.875)
----------------------------------------------------------------------
Ran 4684 tests in 410.483s
FAILED (KNOWNFAIL=379, errors=5, failures=5) |
@xiaoweiz I would try a clean installation (in a fresh env!) to run the test suite and then apply the patch and try again. You can get a patch that can be applied to the code via https://github.com/matplotlib/matplotlib/pull/3564.patch |
This is resolved by #3564 |
Reported also in mwaskom/seaborn#282
Environment: OS X Mavericks
Anaconda python distribution (python 2.7.8)
IPython 2.2.0
Seaborn 0.4
In an ipython terminal or qtconsole, it works with running
However, after importing seaborn, the macosx backend breaks
Interestingly, using
%matplotlib inline
in an IPython notebook works fine. Also, using another backend such as "Qt4Agg" works fine in IPython terminal or qtconsole.After downgrading matplotlib to 1.3.1, the issue goes away.
The text was updated successfully, but these errors were encountered: