python画图加注释_【IT专家】python画图笔记——注释
本文由我司收集整編,推薦下載,如有疑問,請與我司聯系
python
畫圖筆記
——
注釋
2017/02/23
0
一
.
注釋簡介注釋位于
matplotlib.pyplot
下,需要需要實例化后再
在畫布上填寫注釋
import
matplotlib.pyplot
as
plt
fig=plt.figure()
ax=fig.add_subplot(1,1,1)
注釋有三種,分別為
ax.text()
:文本注釋,只能填寫文本
ax.arrow()
:箭頭標記,不能填寫文本
ax.annotate()
:箭頭注釋,在箭頭的位置可以
填寫文本二
.
參數解釋
1.texttext(x,?y,?s,?fontdict=None,?withdash=False,?**kwargs)?x,y
:
注釋的坐標位置(標量)
s
:注釋的內容(字符串)
fontdict
:重新設置注釋內容的
文本格式,包括字體顏色、背景大小和顏色、字體大小等(字典)
withdash
:創建
一個替代注釋內容
“s”
的對象,參照英文單詞解釋,這應該是一個破折號
**kwargs
包括
|?agg_filter:?unknown?|?alpha:?float?(0.0?transparent?through?1.0?opaque)
|?animated:
[True?|?False]
|?axes:?an?:class:`~matplotlib.axes.Axes`?instance
|?backgroundcolor:?any
matplotlib
color
|
bbox:
FancyBboxPatch
prop
dict
|
clip_box:
a
:class:`matplotlib.transforms.Bbox`
instance
|
clip_on:
[True
|
False]
|
clip_path:
[
(:class:`~matplotlib.path.Path`,
:class:`~matplotlib.transforms.Transform`)
|?:class:`~matplotlib.patches.Patch`?|?None?]
|?color:?any?matplotlib?color
|?contains:?a
callable?function
|?family?or?fontfamily?or?fontname?or?name:?[FONTNAME?|?‘serif’?|
‘sans-serif’
|
‘cursive’
|
‘fantasy’
|
‘monospace’
]
|
figure:
a
:class:`matplotlib.figure.Figure`
instance
|
fontproperties
or
font_properties:
a
:class:`matplotlib.font_manager.FontProperties`
instance
|
gid:
an
id
string
|
horizontalalignment?or?ha:?[?‘center’?|?‘right’?|?‘left’?]
|?label:?string?or?anything?printable
with
‘%s’
conversion.
|
linespacing:
float
(multiple
of
font
size)
|
multialignment:
[‘left’?|?‘right’?|?‘center’?]
|?path_effects:?unknown?|?picker:?[None|float|boolean|callable]
|
position:
(x,y)
|
rasterized:
[True
|
False
|
None]
|
rotation:
[
angle
in
degrees
|
‘vertical’?|?‘horizontal’?]
|?rotation_mode:?unknown?|?size?or?fontsize:?[size?in?points?|?‘xx-
small’?|?‘x-small’?|?‘small’?|?‘medium’?|?‘large’?|?‘x-large’?|?‘xx-large’?]
|?sketch_params:
總結
以上是生活随笔為你收集整理的python画图加注释_【IT专家】python画图笔记——注释的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 云南农职《JavaScript交互式网页
- 下一篇: python画图颜色填充_python画