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

ERROR: matplotlib.tests.test_axes.test_contour_colorbar.test fails on Python 3 #1117

Closed
wants to merge 1 commit into from

Conversation

mdboom
Copy link
Member

@mdboom mdboom commented Aug 28, 2012

I'm getting this on Python 3.x only on Fedora 17 with Numpy 1.7dev.

======================================================================
ERROR: matplotlib.tests.test_axes.test_contour_colorbar.test
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/mdboom/python3/lib/python3.2/site-packages/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/home/mdboom/python3/lib/python3.2/site-packages/matplotlib/testing/decorators.py", line 39, in failer
    result = f(*args, **kwargs)
  File "/home/mdboom/python3/lib/python3.2/site-packages/matplotlib/testing/decorators.py", line 145, in do_test
    figure.savefig(actual_fname)
  File "/home/mdboom/python3/lib/python3.2/site-packages/matplotlib/figure.py", line 1229, in savefig
    self.canvas.print_figure(*args, **kwargs)
  File "/home/mdboom/python3/lib/python3.2/site-packages/matplotlib/backend_bases.py", line 2089, in print_figure
    **kwargs)
  File "/home/mdboom/python3/lib/python3.2/site-packages/matplotlib/backend_bases.py", line 1843, in print_pdf
    return pdf.print_pdf(*args, **kwargs)
  File "/home/mdboom/python3/lib/python3.2/site-packages/matplotlib/backends/backend_pdf.py", line 2276, in print_pdf
    self.figure.draw(renderer)
  File "/home/mdboom/python3/lib/python3.2/site-packages/matplotlib/artist.py", line 57, in draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File "/home/mdboom/python3/lib/python3.2/site-packages/matplotlib/figure.py", line 930, in draw
    func(*args)
  File "/home/mdboom/python3/lib/python3.2/site-packages/matplotlib/artist.py", line 57, in draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File "/home/mdboom/python3/lib/python3.2/site-packages/matplotlib/axes.py", line 2002, in draw
    a.draw(renderer)
  File "/home/mdboom/python3/lib/python3.2/site-packages/matplotlib/artist.py", line 57, in draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File "/home/mdboom/python3/lib/python3.2/site-packages/matplotlib/collections.py", line 260, in draw
    self._offset_position)
  File "/home/mdboom/python3/lib/python3.2/site-packages/matplotlib/backends/backend_pdf.py", line 1533, in draw_path_collection
    self.check_gc(gc0, rgbFace)
  File "/home/mdboom/python3/lib/python3.2/site-packages/matplotlib/backends/backend_pdf.py", line 1436, in check_gc
    if delta: self.file.output(*delta)
  File "/home/mdboom/python3/lib/python3.2/site-packages/matplotlib/backends/backend_pdf.py", line 537, in output
    self.write(fill(list(map(pdfRepr, data))))
  File "/home/mdboom/python3/lib/python3.2/site-packages/matplotlib/backends/backend_pdf.py", line 212, in pdfRepr
    % type(obj))
TypeError: Don't know a PDF representation for <class 'numpy.int64'> objects.

@mdboom
Copy link
Member Author

mdboom commented Aug 28, 2012

@jkseppan: Can you have a quick look at this, since it involves the PDF backend?

@jkseppan
Copy link
Member

My suggestion is jkseppan@73c3573

In principle the pdf format differentiates between integers and floating-point numbers, so I would like to represent e.g. numpy.int64 as integers and numpy.float32 as floats (oddly, on my system in Python 3 numpy.int64 does not have int as base, but in Python 2 it does). In practice this probably doesn't matter.

@mdboom
Copy link
Member Author

mdboom commented Aug 28, 2012

I agree your solution looks better. I'll go ahead and merge it.

@mdboom mdboom closed this Aug 28, 2012
@mdboom mdboom deleted the pdf_scalars branch November 9, 2015 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants