Skip to content
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

TestDataFramePlots.test_scatter fails with matplotlib v1.0.1 #1484

Closed
saltantsolutions opened this issue Jun 16, 2012 · 3 comments
Closed

TestDataFramePlots.test_scatter fails with matplotlib v1.0.1 #1484

saltantsolutions opened this issue Jun 16, 2012 · 3 comments
Labels
Milestone

Comments

@saltantsolutions
Copy link

Synopsis

The FreeBSD port for matplotlib has not yet been updated to v1.1.0. In the mean time, this test fails due to a default marker type ('.') that is unknown in matplotlib v1.0.1.

Details

Environment

# uname -a
FreeBSD REDACTED 9.0-STABLE FreeBSD 9.0-STABLE #0 r236450: Sat Jun  2 11:08:51 EDT 2012     root@REDACTED:/usr/obj/usr/src/sys/NIPPL  amd64
# pkg_info -oxQ pandas matplotlib
py27-matplotlib-1.0.1_4:math/py-matplotlib
py27-pandas-0.8.0.b2:math/py-pandas

How to reproduce

#   nosetests -xv pandas.tests.test_graphics:TestDataFramePlots.test_scatter
test_scatter (pandas.tests.test_graphics.TestDataFramePlots) ... ERROR

======================================================================
ERROR: test_scatter (pandas.tests.test_graphics.TestDataFramePlots)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/pandas-0.8.0b2-py2.7-freebsd-9.0-STABLE-amd64.egg/pandas/tests/test_graphics.py", line 252, in test_scatter
    _check_plot_works(scat)
  File "/usr/local/lib/python2.7/site-packages/pandas-0.8.0b2-py2.7-freebsd-9.0-STABLE-amd64.egg/pandas/tests/test_graphics.py", line 301, in _check_plot_works
    ret = f(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/pandas-0.8.0b2-py2.7-freebsd-9.0-STABLE-amd64.egg/pandas/tests/test_graphics.py", line 251, in scat
    return plt.scatter_matrix(df, **kwds)
  File "/usr/local/lib/python2.7/site-packages/pandas-0.8.0b2-py2.7-freebsd-9.0-STABLE-amd64.egg/pandas/tools/plotting.py", line 71, in scatter_matrix
    marker=marker, alpha=alpha, **kwds)
  File "/usr/local/lib/python2.7/site-packages/matplotlib/axes.py", line 5738, in scatter
    raise ValueError('Unknown marker symbol to scatter')
ValueError: Unknown marker symbol to scatter

----------------------------------------------------------------------
Ran 1 test in 0.633s

FAILED (errors=1)

Code analysis

pandas/tests/test_graphics.py:252 does not specify a marker type.
pandas/tools/plotting.py:22 defines '.' as the default value for the marker
matplotlib/axes.py:5669-5682 list the marker types recognized in matplotlib v1.0.1.

Suggested resolution

Choose a marker type available in matplotlib v1.0.1 (e.g. 'o').

@wesm
Copy link
Member

wesm commented Jun 21, 2012

I'll have a look. Would like '.' to be the default but should work around in earlier matplotlib.

@wesm wesm closed this as completed in 87d6da1 Jun 21, 2012
@wesm
Copy link
Member

wesm commented Jun 21, 2012

I added a compatibility function for matplotlib < 1.1

@saltantsolutions
Copy link
Author

Sorry for the slow turn-around responding to this. Thanks for taking a look.

Unfortunately, mlines.lineMarkers is not used by scatter(), so this compatibility function doesn't get the test to pass with matplotlib 1.0.1. I'll see if I can come up with a non-awful way to do the compatibility check, but it probably won't be in time to sneak into 0.8.0.

At least the maintainer update bug was closed and matplotlib 1.1.0 finally made it into the FreeBSD ports tree, so the consequence is attenuated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants