Matplotlib Practice for Python Data Visualization cover

Matplotlib Practice for Python Data Visualization

Rating 2.9
Word count
324 words
Chapters
1
ISBN
9787121348884

Tags

Summary

This is a technical tutorial on Python data visualization practice, centered on the official plotting library matplotlib. The book is organized into four parts—Getting Started, Advancing, Practice, and Extending—with 13 main chapters and 3 appendices. The Getting Started part begins with the basic components of a chart, explaining one by one the roles and parameters of commonly used functions such as plot(), scatter(), xlim(), xlabel(), grid(), axhline(), axvspan(), annotate(), text(), title(), and legend(); it then introduces statistical functions such as bar(), barh(), hist(), pie(), polar(), stem(), boxplot(), and errorbar(), and explains the drawing principles, suitable scenarios, and parameter adjustments for charts including bar charts, horizontal bar charts, stacked charts, block charts, line charts, histograms, pie charts, box plots, and error bar charts. The Advancing part focuses on refining chart styles, including axis tick styles, pointing and non-pointing annotations, shadow effects for titles and axis labels, and using subplot(), subplot2grid(), and subplots() to divide the canvas and share axes within the same area or across different sub-areas. The Practice part goes deeper into controlling axis position and display forms, as well as setting line and marker styles. The Extending part explains matplotlib's code-level and project-level configuration, font and text attribute settings, the use of color parameters and colormaps, and displaying and saving output graphics. The appendices add basic Python knowledge, NumPy basics, and matplotlib installation methods to help readers with no background get started. All example code uses only basic Python syntax, so readers can focus on visualization itself.

Editor's review

很多 Python 学习者能算出一堆数,却画不出一张能直接放进报告里的图。这本书正好补上这一段:它不铺陈理论,而是把 matplotlib 的函数一个个摊开来讲——这个参数改什么、图形会变成什么样、什么数据适合用什么图。全书结构很有层次:入门篇按「组成元素—统计函数—完整图形—图形完善」的顺序搭台阶;精进篇解决多子图布局和坐标轴共享这类真正让人卡住的问题;演练篇处理坐标轴位置、线型和标记;拓展篇则讲配置、字体、颜色映射与图形导出,这些都是实际出图时绕不开的细节。作者有统计学背景和数据分析师从业经历,选题偏向「数据说话」的场景,柱状图、箱线图、误差棒图、直方图等都交代了绘制原理和适用范围,而不只是贴代码。所有示例只用 Python 基础语法,配合附录的 Python 与 NumPy 基础,零基础读者也能跟上。它适合当作案头工具书边做边查,而不是从头到尾通读一遍。

Who it's for

A good fit for

  • 已经会用 Python 基础语法、想把数据画成图表的初学者
  • 需要定期输出报表、PPT 图表的运营与数据分析从业者
  • 统计、经济、金融等专业需要做数据展示的学生与研究者
  • 想系统掌握 matplotlib 函数参数与样式细节的自学者

Not a good fit for

  • 完全没有 Python 基础、连列表和循环都不熟悉的读者
  • 希望学习交互式可视化(Plotly、Bokeh、Tableau)的人
  • 期待深度讲解统计建模或数据清洗方法论的读者

Reading tips

  1. 先跑通附录 C 的安装步骤,把环境配好,再逐章动手敲代码,比只看不动手有效得多。
  2. 入门篇可顺序阅读,精进篇和拓展篇适合按需查阅,遇到布局、字体或配色问题直接翻对应章节。
  3. 每学一个函数,换用自己的真实数据重画一遍,并试着改动参数对比效果,形成自己的参数笔记。
  4. 注意书中示例基于 2018 年前后的 matplotlib 版本,部分默认样式与新版有差异,遇到报错先查官方文档。

About the publisher

Publishing House of Electronics Industry China · Founded in 1982

The Publishing House of Electronics Industry is a comprehensive publisher distinguished by its focus on electronic information and related fields. Judging from the more than 3,000 titles in its catalogue, its publishing covers programming and design, artificial intelligence, computer science, finance and economics, photography, and social sciences, attending both to cutting-edge technology and to general readers. Representative titles include Factor Investing: Methods and Practice, x86 Assembly Language: From Real Mode to Protected Mode, The RISC-V Reader, Artificial Intelligence: Speech Recognition, Understanding and Practice, Phased Array Radar Technology, Radar Target Characteristics, and 100 Go Mistakes and How to Avoid Them, most of which centre on technical methods and engineering practice. Its authors include Shi Chuan, Li Zhong, Wang Xiaobo, David Patterson, Andrew Waterman, and Yu Zihao, among others from China and abroad. Owing to limited public information, no further publishing features are elaborated here.

Contents

  1. Matplotlib Practice for Python Data Visualization

FAQ

这本书需要什么前置基础?
掌握 Python 的基本语法即可,如变量、列表、循环和函数调用。附录 A 与附录 B 分别补充了 Python 和 NumPy 的基础知识,没有统计或绘图经验也能开始。
它和《Python数据可视化之matplotlib精进》有什么区别?
本书是同一作者的入门与系统讲解之作,按入门、精进、演练、拓展四篇组织,侧重函数用法与图形元素;《精进》是后续的案例集,按图形、元素、交互、探索、拓展五部分讲解更复杂的应用场景。建议先读本书。
书中的代码现在还能直接运行吗?
核心 API 基本稳定,大部分示例仍可运行;但 matplotlib 后续版本在默认样式、部分参数命名和字体处理上有变化,个别代码可能需要小幅调整,建议对照当前版本文档。
适合当作查阅用的工具书吗?
适合。目录按函数和图表类型编排,第 1、2 章几乎逐函数讲解,第 6 至 13 章按布局、样式、配置、字体、颜色等主题归类,遇到具体问题可直接定位相应章节。

Comments

Find this book

This site is an index: you start “Search all sources” in your browser, and the entries it lists all point to third-party sites; please judge their availability yourself.

About the author

刘大成 Author

Liu Dacheng is a programming author focused on Python data visualization; public information about him is limited, and no systematic record of his biography is currently available. Two of his works are included in the collection: Python Statistical Visualization: A Practical Guide to Exploratory Analysis with Altair and Python Data Visualization: Advanced Practice with matplotlib. Both center on visualization tools within the Python ecosystem, covering statistical exploratory analysis and advanced plotting practice. His writing stays close to the practical use of these tools, emphasizing hands-on methods and worked examples, and is aimed at developers and data analysis learners who wish to improve their ability to present data. The works are representative entries in the programming design and general computing categories and are suitable as technical learning references.

More by the same author

Top rated in the same category