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

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.

主站蜘蛛池模板: 喜德县| 宁陵县| 商水县| 高陵县| 阳江市| 合川市| 余干县| 本溪市| 新郑市| 绥滨县| 大冶市| 齐河县| 宜川县| 晴隆县| 巴东县| 垫江县| 家居| 安达市| 平湖市| 兴仁县| 东方市| 六安市| 旌德县| 建瓯市| 色达县| 湘乡市| 怀宁县| 杭锦后旗| 无极县| 石渠县| 黎城县| 延长县| 杨浦区| 汉中市| 塔河县| 望谟县| 滦平县| 上蔡县| 拉萨市| 耿马| 鹰潭市|