Yosemite and python matplotlib issue
Question: Can someone help me sort out the issue resulting to such an error. My python
codes were working well until I upgraded to Yosemite. Here is the error:

    
    
    Traceback (most recent call last):
      File "/Users/will/Downloads/legend_demo4.py", line 1, in <module>
        import matplotlib.pyplot as plt
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/pyplot.py", line 26, in <module>
        from matplotlib.figure import Figure, figaspect
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/figure.py", line 32, in <module>
        from matplotlib.image import FigureImage
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/image.py", line 22, in <module>
        import matplotlib._png as _png
    ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/_png.so, 2): Library not loaded: /usr/X11/lib/libpng12.0.dylib
      Referenced from: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/_png.so
      Reason: image not found
    


Answer: I had the same problem. I fixed that by un- (via: easy_install -m matplotlib)
and reinstalling (via: python setup.py build; python setup.py install) the
matplotlib from the [sources](https://github.com/matplotlib/matplotlib) and
afterwards install the
[wheels](https://pypi.python.org/pypi?name=matplotlib&version=1.4.1&:action=display)
package (via: pip install packagename.whl).

