本文共 3872 字,大约阅读时间需要 12 分钟。
matplotlib绘图
Here is my review
这是我的评论
I was given a copy of and asked to review it. Thanks PACKT! Here is my review.
我得到了的副本,并要求对其进行审查。 谢谢! 这是我的评论。
But first, I’ll mention I’ve worked on two projects recently that involved rendering matplotlib graphs directly to the browser i.e. via content-type: image/png. This is fun! It’s particularly enjoyable when you are trying to avoid performing the task “the right way”, which is arguably outputting JSON to some JavaScript graphing library e.g. . The dependencies are heavy i.e. pip install numpy, etc. but not that heavy and once they are installed, your web application can output graphs rivaling those produced by JavaScript, all written in Python . Highly recommended!
但是首先,我要提到我最近从事了两个项目,这些项目涉及直接将matplotlib图形渲染到浏览器,即通过内容类型:image / png。 这好有趣! 当您尝试避免以“正确的方式”执行任务时,这尤其令人愉快,因为可以将JSON输出到某些JavaScript图形库(例如 。 依赖性很重,即pip install numpy等,但不那么重,一旦安装, 您的Web应用程序就可以输出与JavaScript产生的图形相抗衡的图形,所有图形均使用Python 编写 。 强烈推荐!
I think the code examples in Chapter 1 alone are worth the price of admission. Here is a video of me walking through the Chapter 1 code examples:
我认为仅第1章中的代码示例就值得接受。 这是我逐步学习第1章代码示例的视频:
You’ll notice the typical fare here: bar, line and pie graphs along with some more complex boxplot, histogram, horizontal bar, scatter and triangle graphs, all in various colors. For reference, here are the excerpted commands called to produce these graphs:
您会在这里注意到典型的票价:条形图,折线图和饼图以及一些更复杂的箱线图,直方图,水平条形图,散点图和三角形图,所有颜色都不同。 作为参考,以下是摘录的生成这些图的命令:
Chapter 2 is all about customization e.g. via matplotlibrc. Here is a video of me walking through the Chapter 2 code examples:
第2章都是关于定制的,例如通过matplotlibrc。 这是我逐步学习第2章代码示例的视频:
For reference, here is the sample matplotlibrc included with the matplotlib distribution (lib/python2.7/site-packages/matplotlib/mpl-data/matplotlibrc):
作为参考,这是matplotlib发行版(lib / python2.7 / site-packages / matplotlib / mpl-data / matplotlibrc)中随附的示例matplotlibrc:
As you can see, there are a lot of knobs you can turn here.
如您所见,您可以在此处转动许多旋钮。
Chapter 3 is all about “annotations”. Here is a video of me walking through the Chapter 3 code examples:
第三章都是关于“注释”的。 这是我逐步学习第3章代码示例的视频:
“Annotations” includes related topics such as adding shapes and controlling tick spacing and labeling.
“注释”包括相关主题,例如添加形状以及控制刻度线间距和标记。
Chapter 4 is all about “working with figures”. Here is a video of me walking through the Chapter 4 code examples:
第四章都是关于“与数字打交道”的。 这是我逐步学习第4章代码示例的视频:
“Working with figures” includes obvious topics like subplot
and less obvious topics like setting the aspect ratio.
“使用图形”包括subplot
等明显主题,而设置纵横比则不太明显。
Chapter 5 is all about “working with file output”. For reference, here are some of the images produced by the examples in this chapter (I wrote jpg
files instead of png
files due to a problem with my libpng: .)
第5章都是关于“处理文件输出”的。 作为参考,这是本章中的示例生成的一些图像(由于libpng出现问题,我编写了jpg
文件而不是png
文件: 。)
Also covered in this chapter is .
本章还介绍了 。
Chapter 6 is all about “working with maps”.
第6章都是关于“使用地图”的。
This chapter also introduces the .
本章还介绍了 。
Chapter 7 is all about “working with 3D figures”.
第7章全部涉及“使用3D图形”。
For reference, here are the excerpted commands called to produce these graphs:
作为参考,以下是摘录的生成这些图的命令:
Chapter 8 is all about working with the “user interface” interactively.
第8章全部涉及交互式使用“用户界面”。
Additionally, all of the popular graphical windowing environments are discussed: Tkinter, wxWidgets, GTK, Pyglet (three out of four of which I was able to install; GTK 2 vs GTK 3 .
此外,还讨论了所有流行的图形窗口环境:Tkinter,wxWidgets,GTK,Pyglet(我能够安装其中的四个; GTK 2 vs GTK 3使 。
Overall I enjoyed this book and would .
总的来说,我喜欢这本书, 。
(You should probably or or both. And speaking of PACKT, you should definitely .)
(您可能应该或或同时两者 。谈到PACKT,您也绝对应该 。)
.很熟悉。 |
翻译自:
matplotlib绘图
转载地址:http://bsqwd.baihongyu.com/