python data analysis data visualization:(python数据分析数据可视化)
Data Visualization
One of the first steps in data analysis is visualization. Even when looking at a table of
values, we can form a mental image of what the data might look like when graphed.
Data visualization calls for the conception and analysis of the visual representation of
information, signifying data that has been abstracted in some formal pattern, including
properties or quantities for units of measurements of the data. Data visualization is
tightly associated with scientific visualization and statistical graphics. The Python
matplotlib (all lowercase) library is a well-known plotting library based on NumPy,
which we will be using in this chapter. It has an object-oriented and a procedural
MATLAB-like API, which can be used in parallel. A gallery with matplotlib examples
can be found at /gallery.html. The following is a list of
topics that will be covered in this chapter:
• Basic matplotlib plots
• Logarithmic plots
• Scatter plots
• Legends and annotations
• Three-dimensional plots
• Plotting in pandas
• Lag plots
• Autocorrelation plots
• Plot.ly
Data Visualization
matplotlib subpackages
If we pick up our pkg_check.py file provided in the code bundle and change the
code to list the matplotlib subpackages, we get the following result:
matplotlib version 1.3.1
matplotlib.axes
matplotlib.backends
pat
matplotlib.delaunay DESCRIPTION :Author: Robert Kern
:Copyright: Copyright 2005 Robert Kern.
:License: BSD-style license. See LICENSE.tx
jections
matplotlib.sphinxext
matplotlib.style
matplotlib.testing
matplotlib.tests
matplotlib.tri
The subpackage names are pretty self-explanatory. Backends refers to the way
the end result is output. This can be one of several file formats or on the screen
in a graphical user interface. For completeness, refer to the following snippet
with the changed lines in pkg_che