In this case study , Will make use of Matplotlib Package for visual analysis of data , Draw relevant charts , Data analysis .
(1) Basic introduction
Matplotlib yes Python Drawing library of . It can be connected with NumPy Use it together , Provides an effective MatLab Open source alternatives . It can also be used with the graphics toolkit , Such as PyQt and wxPython.
(2)matplotlib install :
Linux System
Situation 1 、 If you're using the system's own Python edition , You can use the system's package manager to install matplotlib, To do this, just execute a single command :
$ sudo apt-get install python3-matplotlib
Case 2 、 If you're using Python 2.7
$ sudo apt-get install python-matplotlib
Situation 3 、 If you install a newer Python edition , It has to be installed matplotlib Some of the libraries that you depend on :
$ sudo apt-get install python3.5-dev python3.5-tk tk-dev $ sudo apt-get install libfreetype6-dev g++
Reuse pip To install matplotlib:
$ pip install --user matplotlib
OS X System
Apple Standards for Python Installation comes with matplotlib.
If it passes the inspection , Found no , Then install through the following statement
$ pip install --user matplotlib
【 Be careful 】: You may need to use... When installing packages pip3 , instead of pip . in addition , If this command doesn't work , You may need to delete the flag –user.
Windows System
stay Windows In the system , Installation is required first VisualStudio.
Method 1 、 Download the image installation package
Please visit https://pypi.python.org/pypi/matplotlib/ , And find the... That you use Python The version matches wheel file ( extension .whl The file of ). for example , If you make It's using 32 Bit Python 3.5, You need to download matplotlib-1.4.3-cp35-none-win32.whl.
Method 2 、 Command line pip Installation
pip install matplotlib
Method 3 、 If you use pycharm development tool , Then the program can be in setting Installation in
setting–>project–>Python Interpreter After entering , choice pip, Select Search matplotlib, Then install .