本文簡要介紹 python 語言中 matplotlib.pyplot.xkcd
的用法。
-
打開xkcdsketch-style繪圖模式。這隻會對調用此函數後繪製的內容產生影響。
為獲得最佳效果,應安裝 "Humor Sans" 字體:它不包含在 Matplotlib 中。
- 參數:
- scale 浮點數,可選
-
垂直於源線的擺動幅度。
- length 浮點數,可選
-
沿線擺動的長度。
- randomness 浮點數,可選
-
長度縮小或擴展的比例因子。
注意
此函數由多個 rcParams 工作,因此它可能會覆蓋您之前設置的其他函數。
如果你希望這個函數的效果是暫時的,它可以用作上下文管理器,例如:
with plt.xkcd(): # This figure will be in XKCD-style fig1 = plt.figure() # ... # This figure will be in regular style fig2 = plt.figure()
用法
matplotlib.pyplot.xkcd(scale=1, length=100, randomness=2)
相關用法
- Python matplotlib xticks用法及代碼示例
- Python matplotlib xlim用法及代碼示例
- Python matplotlib axvspan用法及代碼示例
- Python matplotlib Axes.get_legend_handles_labels用法及代碼示例
- Python matplotlib AbstractMovieWriter用法及代碼示例
- Python matplotlib triplot用法及代碼示例
- Python matplotlib StarPolygonCollection.set_hatch用法及代碼示例
- Python matplotlib Axes.hist用法及代碼示例
- Python matplotlib boxplot用法及代碼示例
- Python matplotlib subplots用法及代碼示例
- Python matplotlib InsetPosition用法及代碼示例
- Python matplotlib ToolManager.toolmanager_disconnect用法及代碼示例
- 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用法及代碼示例
- Python matplotlib Axes.semilogx用法及代碼示例
- Python matplotlib Axes.semilogy用法及代碼示例
- Python matplotlib MovieWriterRegistry.register用法及代碼示例
- Python matplotlib PolyQuadMesh.set_hatch用法及代碼示例
- Python matplotlib warn_deprecated用法及代碼示例
- Python matplotlib Text.set_bbox用法及代碼示例
注:本文由純淨天空篩選整理自skytowner.com大神的英文原創作品 matplotlib.pyplot.xkcd。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。