简单Coord01注释示例

简单Coord01注释示例

  1. import matplotlib.pyplot as plt
  2. fig, ax = plt.subplots(figsize=(3, 2))
  3. an1 = ax.annotate("Test 1", xy=(0.5, 0.5), xycoords="data",
  4. va="center", ha="center",
  5. bbox=dict(boxstyle="round", fc="w"))
  6. an2 = ax.annotate("Test 2", xy=(1, 0.5), xycoords=an1,
  7. xytext=(30, 0), textcoords="offset points",
  8. va="center", ha="left",
  9. bbox=dict(boxstyle="round", fc="w"),
  10. arrowprops=dict(arrowstyle="->"))
  11. plt.show()

下载这个示例