本文簡要介紹 python 語言中 matplotlib.textpath.TextToPath.get_text_path
的用法。
-
將文本
s
轉換為路徑(matplotlib.path.Path 的頂點和代碼元組)。- prop
FontProperties
-
文本的字體屬性。
- s str
-
要轉換的文本。
- ismath {假,真,"TeX"}
-
如果為 True,則使用 mathtext 解析器。如果"TeX",使用tex進行渲染。
- prop
- verts 列表
-
包含頂點的 x 和 y 坐標的 numpy 數組列表。
- codes 列表
-
路徑代碼列表。
參數
返回
例子
從文本創建一個頂點和代碼列表,並從這些創建一個
Path
:from matplotlib.path import Path from matplotlib.textpath import TextToPath from matplotlib.font_manager import FontProperties fp = FontProperties(family="Humor Sans", style="italic") verts, codes = TextToPath().get_text_path(fp, "ABC") path = Path(verts, codes, closed=False)
另請參閱
TextPath
了解從文本創建路徑的更直接方法。
用法
get_text_path(prop, s, ismath=False)
相關用法
- Python matplotlib Text.set_bbox用法及代碼示例
- Python matplotlib TextPath用法及代碼示例
- Python matplotlib TexManager.get_rgba用法及代碼示例
- Python matplotlib ToolManager.toolmanager_disconnect用法及代碼示例
- Python matplotlib TriMesh.sticky_edges用法及代碼示例
- Python matplotlib TwoSlopeNorm用法及代碼示例
- Python matplotlib Table.edges用法及代碼示例
- Python matplotlib TriMesh.set_hatch用法及代碼示例
- Python matplotlib Transform.__sub__用法及代碼示例
- Python matplotlib Table.set_fontsize用法及代碼示例
- Python matplotlib axvspan用法及代碼示例
- Python matplotlib Axes.get_legend_handles_labels用法及代碼示例
- Python matplotlib AbstractMovieWriter用法及代碼示例
- Python matplotlib triplot用法及代碼示例
- Python matplotlib StarPolygonCollection.set_hatch用法及代碼示例
- Python matplotlib boxplot用法及代碼示例
- Python matplotlib subplots用法及代碼示例
- Python matplotlib InsetPosition用法及代碼示例
- Python matplotlib Figure.set_size_inches用法及代碼示例
- Python matplotlib figlegend用法及代碼示例
- Python matplotlib Axes.step用法及代碼示例
- Python matplotlib Axes.contour用法及代碼示例
- Python matplotlib LassoSelector用法及代碼示例
- Python matplotlib BrokenBarHCollection.set_hatch用法及代碼示例
- Python matplotlib Axes.plot用法及代碼示例
注:本文由純淨天空篩選整理自skytowner.com大神的英文原創作品 matplotlib.textpath.TextToPath.get_text_path。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。