A few words of nagging:In the near future to do data analysis, need to do visual processing of data, that is, drawing, is usually done with Matlib, but matlib installation file is too large, do not want to use it directly, it is said that its code running efficiency is very low, in the Internet can first use Java to do data processing, and then call Matlib to draw, in addition , you can also use Matplotlib, which is written in
The libraries that Python needs to use in data science:A. Numpy: Scientific Computing Library. A library that provides matrix operations.B. Pandas: Data Analysis Processing LibraryC. SCIPY: Numerical calculation library. The numerical integration and the solution algorithm of ordinary differential equations are provided. Provides a very broad set of specific functions.D. Matplotlib: Data Visualization Libra
Tags: org python standard tar wget via sudo syntax leaseThere are a lot of problems when installing Ubuntu installation matplotlib, simply make a memo:It is necessary to install its dependent packages libpng and FreeType firstInstall libpng:sudo apt-get install Libpng-devInstall FreeType:CD ~/downloadswget https://download.savannah.gnu.org/releases/freetype/freetype-2.4.10.tar.gzTar zxvf freetype-2.4.10.tar
I have an error when I run the matplotlib after the first installation.1 Import Matplotlib as MLB 2 from Import Pylab as PL 3 4 5 x = [1,3,5,7,6,9,10,13,16]6 y = [3,4,5,7,9,0,1,2,3]78 pl.plot (x, y)9 pl.show ()Error contentRuntimeerror:python is not installed as a framework. The Mac OS X backend'll isn't able to function correctly if Python was not installed as
Mac system, after the installation of Matplotlib, import Matplotlib.pyplot when the errorRuntimeerror:python is not installed as a framework. The Mac OS X backend is not being able tofunctionCorrectlyifPython is not installed as a framework. See the Python documentation for MoreInformation on installing Python as aFramework on MAC OS X. Either reinstall
Recently, I had to spend some pictures, which were originally intended to use matlab. However, sometimes matplotlib could not be tolerated by matlab. I am familiar with and like Python, so matplotlib replaces matlab.
After a few days of use, I felt good, but I felt that the document was not full enough. Some links on the web version could not be opened, so there
Matplotlib: Drawing Image instances that meet the requirements of the thesis (mandatory ),
Recently, we need to plot the experiment data. Because we use python for the experiment, we naturally use matplotlib for plotting.
The following code can be used as the template code for drawing. The Code contains detailed notes and can be changed as needed.
#-*-Coding: UTF
=(1.8,0.5),xytext=(tx,ty),arrowprops=dict(arrowstyle="->",connectionstyle="arc3"))plt.show()
This is simple, so don't be too complicated.
Summary
The above is a brief introduction to Matplotlib and the simple use of pyplot-all content of text annotation and arrow, and I hope to help you. Interested friends can continue to refer to this site:
《Use matplotlib to draw a contour map"
《
System Windows 7 64-bitPython 2.7.10, originally loaded is the 64-bit version, but NumPy and SciPy did not find 64-bit version, downloaded 32-bit version, the installation will be prompted Python27 is not Found in the regestry, so change Python to a 32-bit version and then install it. Python27 32-bit versionHttps://www.python.org/ftp/python/2.7.10/python-2.
The Python3.4 import matplotlib on a Windows 7 x64 system encounters some problems and is eventually resolved by looking for a solution:Download the WHL file required for Python 3.4 to install matplotlib under the Windows 64-bit system: (http://www.lfd.uci.edu/~gohlke/pythonlibs/)Numpy-1.9.2cp34-none-win_amd64.whlScipy-0.16.0rc1-cp34-none-win_amd64.whl
Tags: build its ucid rebuild Rand bit HTTP str RAMFirst, the Mac needs to download the Simhei.ttf font and install it, then follow the steps below to copy the Simhei.ttf to the ~python installation path/site-packages/matplotlib/mpl-data/fonts/ttf directory;Link: Https://pan.baidu.com/s/1hsGhxmG Password: rsteTwo. Then modify the ~python installation path/SITE-PAC
First install matplotlib, use pip install Matplotlib. After the installation is completed, in the command line of Python, import matplotlib, if no problem, the installation can start drawing.Watch the moment, witness the miracle. from Import Pyplot as Pltplt.plot ([1,2,3,4,5],[4,3,4,3,4]) # paint plt.show on canvas (
, 2.7, 2.75, 2.8, 2.85, 2.9, 2.95, 3. , 3.05, 3.1 , 3.15, 3.2, 3.25, 3.3, 3.35, 3.4, 3.45, 3.5, 3.55, 3.6, 3.65, 3.7, 3.75, 3.8, 3.85, 3.9, 3.95])>>> plt.plot (x, Np.sin (0.5 * Np.pi *x)) []>>> Plt.show ()4. Line StyleControlling Line PropertiesLines has many attributes that can set:linewidth, dash style, antialiased, etc; See Matplotlib.lines.Line2D. There is several ways to set line properties
use keyword args: plt. (xy Linewidth=2.0)
use the setter methods
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.