文字水印

添加文字水印。

  1. import numpy as np
  2. import matplotlib.pyplot as plt
  3. # Fixing random state for reproducibility
  4. np.random.seed(19680801)
  5. fig, ax = plt.subplots()
  6. ax.plot(np.random.rand(20), '-o', ms=20, lw=2, alpha=0.7, mfc='orange')
  7. ax.grid()
  8. fig.text(0.95, 0.05, 'Property of MPL',
  9. fontsize=50, color='gray',
  10. ha='right', va='bottom', alpha=0.5)
  11. plt.show()

文字水印示例

参考

此示例中显示了以下函数,方法,类和模块的使用:

  1. import matplotlib
  2. matplotlib.figure.Figure.text

下载这个示例