Skip to content

Commit 1f93565

Browse files
committed
update.
1 parent e85e017 commit 1f93565

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

docs/tutorials/intermediate/color_cycle.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ print(yy.shape)
3535
(50, 4)
3636
```
3737

38-
So yy[:, i] will give you the i-th offset sine curve. Let's set the default prop_cycle using [matplotlib.pyplot.rc()](https://matplotlib.org/api/_as_gen/matplotlib.pyplot.rc.html#matplotlib.pyplot.rc). We'll combine a color cycler and a linestyle cycler by adding (+) two cycler's together. See the bottom of this tutorial for more information about combining different cyclers.
38+
所以 yy[:, i] 会给你第i个偏移正弦曲线。让我们使用[matplotlib.pyplot.rc()](https://matplotlib.org/api/_as_gen/matplotlib.pyplot.rc.html#matplotlib.pyplot.rc)设置默认的prop_cycle。我们将通过添加(+)两个循环仪来组合颜色循环仪和线型循环仪。有关组合不同循环仪的更多信息,请参阅本教程的底部。
3939

4040
```python
4141
default_cycler = (cycler(color=['r', 'g', 'b', 'y']) +
@@ -45,7 +45,7 @@ plt.rc('lines', linewidth=4)
4545
plt.rc('axes', prop_cycle=default_cycler)
4646
```
4747

48-
Now we'll generate a figure with two axes, one on top of the other. On the first axis, we'll plot with the default cycler. On the second axis, we'll set the prop_cycler using matplotlib.axes.Axes.set_prop_cycle() which will only set the prop_cycle for this matplotlib.axes.Axes instance. We'll use a second cycler that combines a color cycler and a linewidth cycler.
48+
现在我们将生成一个有两个轴的图形,一个在另一个上面。在第一个轴上,我们将使用默认的循环器进行绘图。在第二个轴上,我们将使用[matplotlib.axes.Axes.set_prop_cycle()](https://matplotlib.org/api/_as_gen/matplotlib.axes.Axes.set_prop_cycle.html#matplotlib.axes.Axes.set_prop_cycle)设置prop_cycler,它只会为此[matplotlib.axes.Axes](https://matplotlib.org/api/axes_api.html#matplotlib.axes.Axes)实例设置prop_cycle。我们将使用第二台循环仪,它结合了色循环仪和线宽循环仪。
4949

5050
```python
5151
custom_cycler = (cycler(color=['c', 'm', 'y', 'k']) +
@@ -65,17 +65,17 @@ plt.show()
6565

6666
![用cycler定型示例](/static/images/tutorials/sphx_glr_color_cycle_001.png)
6767

68-
## Setting prop_cycler in the matplotlibrc file or style files
68+
## 在matplotlibrc文件或样式文件中设置prop_cycler
6969

70-
Remember, if you want to set a custom prop_cycler in your .matplotlibrc file or a style file (style.mplstyle), you can set the axes.prop_cycle property:
70+
请记住,如果要在.matplotlibrc文件或样式文件(style.mplstyle)中设置自定义prop_cycler,可以设置axes.prop_cycle属性:
7171

7272
```python
7373
axes.prop_cycle : cycler(color='bgrcmyk')
7474
```
7575

76-
## Cycling through multiple properties
76+
## 循环访问多个属性
7777

78-
You can add cyclers:
78+
您可以添加以下循环器:
7979

8080
```python
8181
from cycler import cycler
@@ -85,15 +85,15 @@ for d in cc:
8585
print(d)
8686
```
8787

88-
Results in:
88+
结果:
8989

9090
```python
9191
{'color': 'r', 'linestyle': '-'}
9292
{'color': 'g', 'linestyle': '--'}
9393
{'color': 'b', 'linestyle': '-.'}
9494
```
9595

96-
You can multiply cyclers:
96+
你可以使用多个循环器:
9797

9898
```python
9999
from cycler import cycler
@@ -103,7 +103,7 @@ for d in cc:
103103
print(d)
104104
```
105105

106-
Results in:
106+
结果:
107107

108108
```python
109109
{'color': 'r', 'linestyle': '-'}
@@ -120,4 +120,4 @@ Results in:
120120
## 下载本文的所有示例
121121

122122
- [下载python源码: color_cycle.py](https://matplotlib.org/_downloads/1f3835aefda3bd4f236d497eb3c144a7/color_cycle.py)
123-
- [下载Jupyter notebook: color_cycle.ipynb](https://matplotlib.org/_downloads/a1e8abef996b274af371201c7786a041/color_cycle.ipynb)
123+
- [下载Jupyter notebook: color_cycle.ipynb](https://matplotlib.org/_downloads/a1e8abef996b274af371201c7786a041/color_cycle.ipynb)

0 commit comments

Comments
 (0)