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

mplot3d: backend_pdf.py problem with last release not present in 1.2.1rc1 #2058

Closed
khyox opened this issue May 24, 2013 · 5 comments
Closed

Comments

@khyox
Copy link
Contributor

khyox commented May 24, 2013

Bad luckily, in my first plot with matplotlib I fell in this issue:
http://stackoverflow.com/questions/7906365/matplotlib-savefig-plots-different-from-show
that redirected me to:
#786 and, finally, to:
#1223 . I reproduced in
mac OSX the problem generating pdf, ps, and eps with a python code
very similar to the mplot3d trisurf3d_demo.py example.

With the hope that the last 1.3.x development version I cloned the
'master' branch from github. I followed the special instructions in
README.osx, installed all the dependencies via macports. I built the
code using python 3.3.1. When trying to run my python script, I got
the following:

Traceback (most recent call last):
  File "./test_EventDensity.py", line 30, in <module>
    plt.savefig(dirname+pdfname, dpi=fig.dpi)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/matplotlib-1.3.x-py3.3-macosx-10.7-x86_64.egg/matplotlib/pyplot.py",
line 494, in savefig
    return fig.savefig(*args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/matplotlib-1.3.x-py3.3-macosx-10.7-x86_64.egg/matplotlib/figure.py",
line 1404, in savefig
    self.canvas.print_figure(*args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/matplotlib-1.3.x-py3.3-macosx-10.7-x86_64.egg/matplotlib/backend_bases.py",
line 2164, in print_figure
    **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/matplotlib-1.3.x-py3.3-macosx-10.7-x86_64.egg/matplotlib/backend_bases.py",
line 1897, in print_pdf
    return pdf.print_pdf(*args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/matplotlib-1.3.x-py3.3-macosx-10.7-x86_64.egg/matplotlib/backends/backend_pdf.py",
line 2335, in print_pdf
    self.figure.draw(renderer)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/matplotlib-1.3.x-py3.3-macosx-10.7-x86_64.egg/matplotlib/artist.py",
line 55, in draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/matplotlib-1.3.x-py3.3-macosx-10.7-x86_64.egg/matplotlib/figure.py",
line 1028, in draw
    func(*args)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/matplotlib-1.3.x-py3.3-macosx-10.7-x86_64.egg/mpl_toolkits/mplot3d/axes3d.py",
line 270, in draw
    Axes.draw(self, renderer)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/matplotlib-1.3.x-py3.3-macosx-10.7-x86_64.egg/matplotlib/artist.py",
line 55, in draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/matplotlib-1.3.x-py3.3-macosx-10.7-x86_64.egg/matplotlib/axes.py",
line 2088, in draw
    a.draw(renderer)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/matplotlib-1.3.x-py3.3-macosx-10.7-x86_64.egg/mpl_toolkits/mplot3d/art3d.py",
line 507, in draw
    return Collection.draw(self, renderer)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/matplotlib-1.3.x-py3.3-macosx-10.7-x86_64.egg/matplotlib/artist.py",
line 55, in draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/matplotlib-1.3.x-py3.3-macosx-10.7-x86_64.egg/matplotlib/collections.py",
line 266, in draw
    self._offset_position)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/matplotlib-1.3.x-py3.3-macosx-10.7-x86_64.egg/matplotlib/backends/backend_pdf.py",
line 1544, in draw_path_collection
    if np.all(facecolors[:, 3] == facecolors[0, 3]):
TypeError: list indices must be integers, not tuple

Then, as I am a complete newbie in python (and matplotlib) I thought
it could be a problem of using python 3.3.1, so I repeated the process
with python 2.7, but I got the same:

Traceback (most recent call last):
  File "./test_EventDensity.py", line 30, in <module>
    plt.savefig(dirname+pdfname, dpi=fig.dpi)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib-1.3.x-py2.7-macosx-10.7-x86_64.egg/matplotlib/pyplot.py",
line 494, in savefig
    return fig.savefig(*args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib-1.3.x-py2.7-macosx-10.7-x86_64.egg/matplotlib/figure.py",
line 1403, in savefig
    self.canvas.print_figure(*args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib-1.3.x-py2.7-macosx-10.7-x86_64.egg/matplotlib/backend_bases.py",
line 2164, in print_figure
    **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib-1.3.x-py2.7-macosx-10.7-x86_64.egg/matplotlib/backend_bases.py",
line 1897, in print_pdf
    return pdf.print_pdf(*args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib-1.3.x-py2.7-macosx-10.7-x86_64.egg/matplotlib/backends/backend_pdf.py",
line 2335, in print_pdf
    self.figure.draw(renderer)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib-1.3.x-py2.7-macosx-10.7-x86_64.egg/matplotlib/artist.py",
line 54, in draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib-1.3.x-py2.7-macosx-10.7-x86_64.egg/matplotlib/figure.py",
line 1027, in draw
    func(*args)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib-1.3.x-py2.7-macosx-10.7-x86_64.egg/mpl_toolkits/mplot3d/axes3d.py",
line 270, in draw
    Axes.draw(self, renderer)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib-1.3.x-py2.7-macosx-10.7-x86_64.egg/matplotlib/artist.py",
line 54, in draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib-1.3.x-py2.7-macosx-10.7-x86_64.egg/matplotlib/axes.py",
line 2086, in draw
    a.draw(renderer)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib-1.3.x-py2.7-macosx-10.7-x86_64.egg/mpl_toolkits/mplot3d/art3d.py",
line 507, in draw
    return Collection.draw(self, renderer)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib-1.3.x-py2.7-macosx-10.7-x86_64.egg/matplotlib/artist.py",
line 54, in draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib-1.3.x-py2.7-macosx-10.7-x86_64.egg/matplotlib/collections.py",
line 265, in draw
    self._offset_position)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib-1.3.x-py2.7-macosx-10.7-x86_64.egg/matplotlib/backends/backend_pdf.py",
line 1544, in draw_path_collection
    if np.all(facecolors[:, 3] == facecolors[0, 3]):
TypeError: list indices must be integers, not tuple

Then, I decided to checkout the last tag, so I rebuilt after checking
out the tag 1.2.1rc1... Some fighting after with macports and
easy_install, I got such version installed for both python 3.3 and
2.7:

import matplotlib as mpl
mpl.version
'1.2.1rc1'

And my script runs perfectly in both of them! So, I post here to
report this... I hope it helps... it could be a bug in 1.3.X that was
not in 1.2.1rc1... or I am doing something bad... but, by the way, I
would like to thank all of you, the developers of matplotlib, for your
work! I wish I could contribute some day in the future!

Unfortunately, the 1.2.1rc1 version is not solving my original issue,
so I cannot get quality vectorial graphics with my mac... I'll try
next with GNU/Linux! :-)

Thanks,
Khyox

@pelson
Copy link
Member

pelson commented May 24, 2013

Do you have any code to reproduce this? A Short, Self Contained, Correct Example would be great.

Thanks for reporting!

@mdboom
Copy link
Member

mdboom commented May 24, 2013

I believe this problem is fixed by 50508af which was included in master only 11 days ago. Is it possible you're not fully up-to-date with master?

@khyox
Copy link
Contributor Author

khyox commented May 24, 2013

I sent an email with that report to matplotlib-devel@lists.sourceforge.net the 12th may but, today, I discovered it has not been distributed to the list, so I decided to open the issue here. I'll fully update with master and come back soon to close the issue. Sorry for any inconvenience!

@pelson
Copy link
Member

pelson commented May 24, 2013

I'll fully update with master and come back soon to close the issue. Sorry for any inconvenience!

Great. No problems @khyox. I'll close the issue, but just re-open it if there is a problem.

Cheers!

@pelson pelson closed this as completed May 24, 2013
@khyox
Copy link
Contributor Author

khyox commented May 24, 2013

I have just checked it, it's working fine now! Thank you very much!

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

No branches or pull requests

3 participants