官术网_书友最值得收藏!

Installing Matplotlib

There are many ways to install Matplotlib on your system. While the library used to have a reputation for being difficult to install on non-Linux systems, it has come a long way since then, along with the rest of the Python ecosystem. Refer to the following command:

$ pip install matplotlib

Most likely, the preceding command would work just fine from the command line. Python Wheels (the next-generation Python package format that has replaced "eggs") for Matplotlib are now available from PyPi for Windows and Mac OS X systems. This method would also work for Linux users; however, it might be more favorable to install it via the system's built-in package manager.

While the core Matplotlib library can be installed with few dependencies, it is a part of a much larger scientific computing ecosystem known as SciPy. Displaying your data is often the easiest part of your application. Processing it is much more difficult, and the SciPy ecosystem most likely has the packages you need to do that. For basic numerical processing and N-dimensional data arrays, there is NumPy. For more advanced but general data processing tools, there is the SciPy package (the name was so catchy, it ended up being used to refer to many different things in the community). For more domain-specific needs, there are "Sci-Kits" such as scikit-learn for artificial intelligence, scikit-image for image processing, and statsmodels for statistical modeling. Another very useful library for data processing is pandas.

This was just a short summary of the packages available in the SciPy ecosystem. Manually managing all of their installations, updates, and dependencies would be difficult for many who just simply want to use the tools. Luckily, there are several distributions of the SciPy Stack available that can keep the menagerie under control. The following are Python distributions that include the SciPy Stack along with many other popular Python packages or make the packages easily available through package management software:

  • Anaconda from Continuum Analytics
  • Canopy from Enthought
  • SciPy Superpack
  • Python(x, y) (Windows only)
  • WinPython (Windows only)
  • Pyzo (Python 3 only)
  • Algorete Loopy from Dartmouth College

Note

For this book, we will assume at least Python 2.7 or 3.2. The requisite packages are numpy, matplotlib, basemap, and scipy. Just about any version of these packages released in the past 3 years should work for most examples in this book (exceptions are noted in this book). The version 0.14.0 of SciPy (released in May 2014) cannot be used in this book due to a (now fixed) regression in its NetCDF reader. Chapter 5, Embedding Matplotlib will have special notes with regards to GUI toolkit packages.

主站蜘蛛池模板: 百色市| 铜陵市| 惠安县| 桐梓县| 德化县| 敦煌市| 卢湾区| 太保市| 上犹县| 连南| 山东| 平湖市| 泰顺县| 曲靖市| 河北区| 买车| 肥西县| 师宗县| 鄂托克前旗| 辽中县| 柘荣县| 栾川县| 天柱县| 陕西省| 河西区| 湟中县| 余庆县| 青岛市| 巩义市| 新宁县| 恩施市| 且末县| 庄河市| 澄迈县| 兴化市| 嘉定区| 沐川县| 绵阳市| 上犹县| 九龙县| 汝南县|