简单Coord02注释示例

简单Coord02注释示例

  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=(0.5, 1.), xycoords=an1,
  7. xytext=(0.5, 1.1), textcoords=(an1, "axes fraction"),
  8. va="bottom", ha="center",
  9. bbox=dict(boxstyle="round", fc="w"),
  10. arrowprops=dict(arrowstyle="->"))
  11. fig.subplots_adjust(top=0.83)
  12. plt.show()

下载这个示例