双对数

双对数示例

  1. import matplotlib.pyplot as plt
  2. fig, (ax1, ax2) = plt.subplots(1, 2)
  3. ax1.set_xscale("log")
  4. ax1.set_yscale("log")
  5. ax1.set_xlim(1e1, 1e3)
  6. ax1.set_ylim(1e2, 1e3)
  7. ax1.set_aspect(1)
  8. ax1.set_title("adjustable = box")
  9. ax2.set_xscale("log")
  10. ax2.set_yscale("log")
  11. ax2.set_adjustable("datalim")
  12. ax2.plot([1, 3, 10], [1, 9, 100], "o-")
  13. ax2.set_xlim(1e-1, 1e2)
  14. ax2.set_ylim(1e-1, 1e3)
  15. ax2.set_aspect(1)
  16. ax2.set_title("adjustable = datalim")
  17. plt.show()

下载这个示例