Free download matplotlib matplotlib for Mac OS X. Matplotlib is a Python 2D plotting library which produces publication quality figures in a variety of hardcopy formats and interactive environments across platforms. Matplotlib can be used in Python. With matplotlib.use; Problem. The full script is published here. To run the script I installed only matplotlib and numpy packages, so the environment on all 3 systems (Windows, Linux, Mac OS) should be the same. Just in case, here they are. It is a little bit of a hack, but I've found it to be the easiest way to get matplotlib installed against the stock python framework that ships with OS X. The stock python framework in 10.7 is actually pretty good, and includes, for instance, a numpy-1.5.1 package that is linked. $ sudo port install py27-matplotlib +gtk2 But on Mac OS X 10.9.1 it seems there is a bug which I receive this error: Error: Dependency 'py27-pyobjc' not found.:- Computing dependencies for py27-matplotlib Error: Dependency 'py27-pyobjc' not found.
$ python -i figureclose.py OS: darwin matplotlib version: 2.0.2 Backend: TkAgg called TclFindHashEntry on deleted table Abort trap: 6 Expected outcome. I would expect this code to create and destroy three figures before creating and retaining the last figure. Matplotlib version. Operating system: Mac OS X 10.12.1; Matplotlib version: 2.0.2.
The following instructions are based on a blog post with some tweaks to install the patched pip packages in the default path rather than leaving them in a local source folder.
The following set of instructions is provided with some annotations. However, the code in each step can (and should!) just be pasted into the terminal window (except for the first part, which belongs in
Successfully tested with
Note that this installation may fail for other versions if they change how modules are treated in SciPy or matplotlib; furthermore, the Python version is hard-coded below.
Oh and by the way, this can take quite a while (compiling
gfortran from source etc.) so grab a cup of coffee.
Just add the following lines at a convenient location to the file
Homebrew is a package manager for Mac that is superior in usage to MacPorts and Fink. However, it can occasionally run into trouble if it is installed side by side with either of those. It's therefore advised to have only Homebrew installed.
(The following command(s) may ask for super user rights.)
This step installs Python 2.7 and makes it the system’s default Python version. This does not uninstall the pre-installed Python, it just deactivates it.
Creating a bootable install disc for mac os x lion.
pip is an easy package manager for Python that acts as a replacement for
easy_install. Ironically, it’s installed using the latter.
For the following operations, we first of all alias
pip to its explicit path just in case one of the previous steps went wrong (this happened, and I’m not exactly sure where, or how to prevent it).
Next, use it to install all the rest.
The previous installations leave behind the sources, and were not properly staged into the Python path; instead, they are lying around in the user’s home folder.The following steps move them to their appropriate location and make sure Python finds them correctly.They also remove the now-redundant source files.
This should display
/usr/local/bin/python as the binary’s path, and 2.7.2 as the version. Then type the following while still in the Python interactive console:
In each case, the path should be somewhere in
Finally, you can also remove the folder
~/src if you don’t need it for other purposes.