Text クラス (matplotlib.text モジュール)
class Text(Artist)
Contents
- 1 設定項目(プロパティ)
- 1.1 backgroundcolor
- 1.2 bbox
- 1.3 clip_box
- 1.4 clip_on
- 1.5 clip_path
- 1.6 color / c
- 1.7 fontfamily / family / (fontname)
- 1.8 fontproperties font_properties
- 1.9 fontsize / size
- 1.10 fontstretch / stretch
- 1.11 fontstyle / style
- 1.12 fontvariant / variant
- 1.13 fontweight / weight
- 1.14 horizontalalignment / ha
- 1.15 linespacing
- 1.16 multialignment / ma
- 1.17 position
- 1.18 rotation
- 1.19 rotation_mode
- 1.20 text
- 1.21 usetex
- 1.22 verticalalignment / va
- 1.23 wrap
- 1.24 x
- 1.25 y
- 2 設定項目(プロパティ) – Artistクラスから継承
設定項目(プロパティ)
backgroundcolor
set_backgroundcolor(color)
- color : 文字列の背景色を指定します <str / tuple(float)>
文字列の背景色を指定します。
色の指定方法はこちらをご覧ください。
bbox
set_bbox(rectprops)
- rectprops : 文字列を囲むボックスのスタイルを指定します <dict>
- ここではFancyBboxPatchクラスのプロパティとしてボックスのスタイルを指定します。
文字列を囲むボックスを指定されたスタイルで描画します。
bboxが指定されると、matplotlib.patches.FancyBboxPatchクラスのインスタンスが生成されて、テキストの周りに表示されるようになります。
clip_box
@ [APIドキュメント] ↑
clip_on
@ [APIドキュメント] ↑
clip_path
@ [APIドキュメント] ↑
color / c
set_color(color) / get_color()
- color : 文字列の色を指定します <str / tuple(float)>
文字列の色を指定します。
色の指定方法はこちらをご覧ください。
fontfamily / family / (fontname)
set_fontfamily(fontname) / get_fontfamily()
- fontname : フォント名 <{FONTNAME, ‘serif’, ‘sans-serif’, ‘cursive’, ‘fantasy’, ‘monospace’}>
指定したフォント名でテキストのフォントを設定します。
fontproperties font_properties
@ [APIドキュメント] ↑
fontsize / size
set_fontsize(fontsize) / get_fontsize()
- fontsize : 文字サイズ <int / float / {‘xx-small’, ‘x-small’, ‘small’, ‘medium’, ‘large’, ‘x-large’, ‘xx-large’}>
文字サイズをポイントもしくは、{‘xx-small’, ‘x-small’, ‘small’, ‘medium’, ‘large’, ‘x-large’, ‘xx-large’}の相対サイズで指定します。
fontstretch / stretch
@ [APIドキュメント] ↑
fontstyle / style
set_fontstyle(fontstyle) / get_fontstyle()
- fontstyle : フォントスタイル <{‘normal’, ‘italic’, ‘oblique’}>
- ‘normal’ -> 通常
- ‘italic’ -> イタリック体
- ‘oblique’ -> 斜体
文字のスタイル(通常 / イタリック体 / 斜体)を指定します。(フォントが対応していれば設定が反映されます)
fontvariant / variant
@ [APIドキュメント] ↑
fontweight / weight
set_fontweight(weight) / get_fontweight()
- weight : 文字の太さ <int / float / {‘ultralight’, ‘light’, ‘normal’, ‘regular’, ‘book’, ‘medium’, ‘roman’, ‘semibold’, ‘demibold’, ‘demi’, ‘bold’, ‘heavy’, ‘extra bold’, ‘black’}>
文字の太さを0~1000の間の数値か、もしくは太さを表す {‘ultralight’, ‘light’, ‘normal’, ‘regular’, ‘book’, ‘medium’, ‘roman’, ‘semibold’, ‘demibold’, ‘demi’, ‘bold’, ‘heavy’, ‘extra bold’, ‘black’}で指定します。
horizontalalignment / ha
@ [APIドキュメント] ↑
linespacing
@ [APIドキュメント] ↑
multialignment / ma
@ [APIドキュメント] ↑
position
@ [APIドキュメント] ↑
rotation
@ [APIドキュメント] ↑
rotation_mode
@ [APIドキュメント] ↑
text
@ [APIドキュメント] ↑
usetex
@ [APIドキュメント] ↑
verticalalignment / va
@ [APIドキュメント] ↑
wrap
@ [APIドキュメント] ↑
x
@ [APIドキュメント] ↑
y
@ [APIドキュメント] ↑
設定項目(プロパティ) – Artistクラスから継承
- agg_filter
- alpha
- animated
- contains
- figure
- gid
- in_layout
- label
- path_effects
- picker
- rasterized
- sketch_params
- snap
- transform
- url
- visible
- zorder