提交 9024dd50 编写于 作者: W wizardforcel

2019-11-19 18:08:59

上级 6e05569d
......@@ -26,7 +26,7 @@ show()
![python_matplotlib_linechart](img/08bb4546f3444dd75f3a9fd52f0a3b34.jpg)
Python [**Matplotlib**](https://pythonspot.com/matplotlib/) Line Chart
Python [**Matplotlib**](https://pythonspot.com/matplotlib/) 折线图
这些行:
......@@ -92,7 +92,7 @@ t = arange(0.0, 20.0, 1)
![python_line_chart](img/dfd62755502ca81aebecea9632e215b4.jpg)
Python Line Chart from List
来自列表的 Python 折线图
## 多个图
......@@ -120,7 +120,7 @@ show()
![python_line_chart_multiple](img/41f0697b9c4ebb9f885ccb0b62b70abc.jpg)
python line chart multiple
python 多个折线图
如果要在同一窗口中的不同视图中绘制它们,可以使用以下方法:
......@@ -152,7 +152,7 @@ plt.show()
![Python subplots](img/5e6dbbe03affb0bf5a05415f48a771ad.jpg)
Python subplots
Python 子图
这里的 plt.subplot()语句是关键。 subplot()命令指定数字,数字和数字。
......
......@@ -24,7 +24,7 @@ plt.show()
![minimal_hist](img/823633047587a7e6edb407963de58da0.jpg)
Python histogram
Python 直方图
## 完整的 matplotlib 直方图
......@@ -63,6 +63,6 @@ plt.show()
![python_histogram](img/e4dfab9c6e230bb2f91a6b0715c548d7.jpg)
python_histogram
Python 直方图
[下载示例](https://pythonspot.com/download-matplotlib-examples/)
\ No newline at end of file
......@@ -6,7 +6,7 @@
## 条形图代码
The code below creates a bar chart:
下面的代码创建一个条形图:
```py
import matplotlib.pyplot as plt; plt.rcdefaults()
......@@ -30,7 +30,7 @@ plt.show()
![figure_barchart](img/91f2efcb7aedc6b7c1fb02870373fc54.jpg)
Python Bar Chart
Python 条形图
[Matplotlib](https://pythonspot.com/matplotlib/) 图表可以是水平的,以创建水平条形图:
......@@ -56,7 +56,7 @@ plt.show()
![Bar chart horizontal](img/b76892fe0218d67c9bf34e469d9dc0a4.jpg)
Bar chart horizontal
水平条形图
## 有关条形图的更多信息
......@@ -102,6 +102,6 @@ plt.show()
![barchart_python](img/b59cd2b0d0a998425f408fe5543c9e37.jpg)
Python Bar Chart comparison
Python 条形图比较
[下载所有 Matplotlib 示例](https://pythonspot.com/download-matplotlib-examples/)
\ No newline at end of file
......@@ -30,7 +30,7 @@ plt.show()
![pie chart python](img/8a804a5303e6f2a4f62d47582241129b.jpg)
pie chart python
python 饼图
要添加图例,请使用 plt.legend()函数:
......@@ -52,6 +52,6 @@ plt.show()
![python pie chart](img/9036abd8c344a4a541cfb80139d9e0d3.jpg)
python pie chart
python 饼图
[下载所有 Matplotlib 示例](https://pythonspot.com/download-matplotlib-examples/)
\ No newline at end of file
......@@ -30,7 +30,7 @@ plt.show()
![matplot-legend](img/a08ca500d9d2d3de81de36faa715c9a4.jpg)
[Matplotlib](https://pythonspot.com/matplotlib/) legend inside
[Matplotlib](https://pythonspot.com/matplotlib/) 内部图例
## Matplotlib 底部图例
......@@ -66,7 +66,7 @@ plt.show()
![matplot-legend-bottom](img/eb28ce9a1b0629a41bede0d2fb88d1a2.jpg)
Legend placed on bottom
放在底部的图例
## Matplotlib 顶部图例
......@@ -78,7 +78,7 @@ ax.legend(loc='upper center', bbox_to_anchor=(0.5, 1.00),  shadow=True, nco
```
码:
码:
```py
......@@ -100,7 +100,7 @@ plt.show()
![matplotlib-legend-top](img/2e9237024699bc650a584770b2742961.jpg)
Legend on top
顶部图例
## 外部右侧图例
......@@ -114,7 +114,7 @@ ax.legend(loc='upper center', bbox_to_anchor=(1.45, 0.8), shadow=True, ncol=1)
```
码:
码:
```py
......@@ -138,6 +138,6 @@ plt.show()
![matplotlib-legend-outside](img/c42c47fbf14b6aaa7f986d9a92760b12.jpg)
[Matplotlib](https://pythonspot.com/matplotlib/) legend outside
[Matplotlib](https://pythonspot.com/matplotlib/) 外部图例
[下载示例](https://pythonspot.com/download-matplotlib-examples/)
\ No newline at end of file
......@@ -4,8 +4,9 @@
## 保存图形
[Matplotlib](https://pythonspot.com/matplotlib/) can save plots directly to a file using savefig().
The method can be used like this:
[Matplotlib](https://pythonspot.com/matplotlib/)可以使用`savefig()`将图直接保存到文件中。
该方法可以像这样使用:
```py
......@@ -54,6 +55,6 @@ display plot.png
![matplotlib-plot-save](img/fc1e1a56cd0872dc8e3ed3e671b21bfb.jpg)
A plot saved to a pdf
保存到 pdf 的图
[下载示例](https://pythonspot.com/download-matplotlib-examples/)
\ No newline at end of file
......@@ -28,7 +28,7 @@ plt.show()
```
[<picture><source srcset="/wp-content/uploads/2016/07/matplotilb-time-1.png.webp" type="image/webp"> <source srcset="/wp-content/uploads/2016/07/matplotilb-time-1.png" type="image/jpeg"> ![matplotilb-time](img/35ae64518583e605bb57af58666ccecd.jpg)</picture> ](/wp-content/uploads/2016/07/matplotilb-time-1.png)
![matplotilb-time](img/35ae64518583e605bb57af58666ccecd.jpg)
如果要更改间隔,请使用以下几行之一:
......
......@@ -8,7 +8,7 @@
## 匹配函数
The match function is defined as:
匹配函数定义为:
```py
re.match(pattern, string)
......@@ -42,7 +42,7 @@ else:
## 电子邮件验证正则表达式
We can use the same function to validate _email address_. The grammar rules are seen in re.compile and in the grammar table.
我们可以使用相同的函数来验证电子邮件地址。 语法规则在`re.compile`和语法表中可见。
| 串 | 比赛 |
| --- | --- |
......@@ -73,7 +73,7 @@ else:
## 搜索函数
The search function is defined as:
搜索函数定义为:
```py
re.search(pattern, string)
......@@ -106,11 +106,11 @@ else:
## 正则表达式示例
A few examples of regular expressions:
正则表达式的一些示例:
## 正则表达式语法
Overview of the regex grammar:
正则表达式语法概述:
| 例 | 正则表达式 |
| --- | --- |
......
......@@ -14,7 +14,7 @@ sudo apt-get update
sudo apt-get install python-qutip
```
We then start Python from the command line and type the commands listed below ( >>> ).
然后,我们从命令行启动 Python 并键入下面列出的命令(`>>>`)。
```py
$ python
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册