Python matplotlibで学ぶ…グラフ描画プログラム 新しいページはコチラ
提供: yonewiki
(→54行目~57行目) |
(→54行目~57行目) |
||
476行: | 476行: | ||
:::*'--' or 'dashed' 破線 | :::*'--' or 'dashed' 破線 | ||
:::*'-.' or 'dashdot' 1点鎖線 | :::*'-.' or 'dashdot' 1点鎖線 | ||
− | :::*':' or 'dotted' | + | :::*':' or 'dotted' 点線 |
+ | |||
+ | |||
+ | :arrowstyleはarrowprops同様に変数に格納して付与することが出来ます。 | ||
+ | <syntaxhighlight2 lang="python"> | ||
+ | from matplotlib.patches import ArrowStyle | ||
+ | arrow_style = ArrowStyle('<|-|>', head_length=1, head_width=1) | ||
+ | ax.annotate(s = '', xy = (0, 3.01), xytext = (0, -3.01), xycoords = 'data', arrowprops = dict( facecolor = 'black', arrowstyle = arrow_style, lw = 0.5, shrinkA = 0, shrinkB = 0)) | ||
+ | </syntaxhighlight2> | ||
+ | :上記のようにarrowstyleに代入できます。このときの最初の引数には各種スタイルキーワードと遂になったキーワード文字列があります。 | ||
+ | ::*'-' = 'Curve' | ||
+ | ::*'simple'= 'Simple' | ||
+ | ::*'wedge' = 'Wedge' | ||
+ | ::*'fancy' = 'Fancy' | ||
+ | ::*'<|-|>' = 'CurveFilledAB' | ||
+ | ::*'<|-' = 'CurveFilledA' | ||
+ | ::*'-|>' = 'CurveFilledB' | ||
+ | ::*'<->' = 'CurveAB' | ||
+ | ::*'<-' = 'CurveA' | ||
+ | ::*'->' = 'CurveB' | ||
+ | ::*']-[' = 'BracketAB' | ||
+ | ::*']-' = 'BracketA' | ||
+ | ::*'-[' = 'BracketB' | ||
+ | ::*'|-|' = 'BarAB' |