mirror of
https://github.com/apachecn/ailearning.git
synced 2026-05-04 04:04:56 +08:00
2020-10-19 21:08:55
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
|
||||
In [1]:
|
||||
|
||||
```
|
||||
```py
|
||||
import numpy.random
|
||||
import matplotlib.pyplot as plt
|
||||
%matplotlib inline
|
||||
@@ -353,7 +353,7 @@ RU5ErkJggg==
|
||||
|
||||
`text()` 函数接受 `bbox` 参数来绘制文本框。
|
||||
|
||||
```
|
||||
```py
|
||||
bbox_props = dict(boxstyle="rarrow,pad=0.3", fc="cyan", ec="b", lw=2)
|
||||
t = ax.text(0, 0, "Direction", ha="center", va="center", rotation=45,
|
||||
size=15,
|
||||
@@ -363,7 +363,7 @@ t = ax.text(0, 0, "Direction", ha="center", va="center", rotation=45,
|
||||
|
||||
可以这样来获取这个文本框,并对其参数进行修改:
|
||||
|
||||
```
|
||||
```py
|
||||
bb = t.get_bbox_patch()
|
||||
bb.set_boxstyle("rarrow", pad=0.6)
|
||||
|
||||
@@ -383,7 +383,7 @@ bb.set_boxstyle("rarrow", pad=0.6)
|
||||
|
||||
In [2]:
|
||||
|
||||
```
|
||||
```py
|
||||
import matplotlib.patches as mpatch
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
@@ -805,7 +805,7 @@ RK5CYII=
|
||||
|
||||
In [3]:
|
||||
|
||||
```
|
||||
```py
|
||||
plt.figure(1, figsize=(3,3))
|
||||
ax = plt.subplot(111)
|
||||
|
||||
@@ -884,7 +884,7 @@ s0T+b9hmiRyPWSLHY5bI8ZglcjxmiRyPWSLHY5bo/3ysOsDVDV6UAAAAAElFTkSuQmCC
|
||||
|
||||
In [4]:
|
||||
|
||||
```
|
||||
```py
|
||||
import matplotlib.pyplot as plt
|
||||
import matplotlib.patches as mpatches
|
||||
|
||||
@@ -1194,7 +1194,7 @@ o4aCEEIIIQn7f35zqmEqULpsAAAAAElFTkSuQmCC
|
||||
|
||||
In [5]:
|
||||
|
||||
```
|
||||
```py
|
||||
import matplotlib.pyplot as plt
|
||||
import matplotlib.patches as mpatches
|
||||
|
||||
@@ -1818,7 +1818,7 @@ o4KCEEIIIRqjgoIQQgghGvt/FlbD4KMSO5AAAAAASUVORK5CYII=
|
||||
|
||||
In [6]:
|
||||
|
||||
```
|
||||
```py
|
||||
import matplotlib.patches as mpatches
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
|
||||
Reference in New Issue
Block a user