【问题标题】:Saving figures using plt.savfig on Google Colab with axes在 Google Colab 上使用 plt.savefig 保存数字
【发布时间】:2023-03-08 20:23:01
【问题描述】:

我正在尝试使用以下方法在我的代码中自动保存数字:

from google.colab import files
plt.savefig("abc.png")
files.download("abc.png") 

但是当我下载这些数字时,它们缺少 x 轴文本的下半部分,我该如何保留它?谢谢!

【问题讨论】:

    标签: python matplotlib save google-colaboratory


    【解决方案1】:

    试试

    plt.savefig(<name>, bbox_inches = 'tight')
    

    或尝试为您的身材指定固定尺寸 然后保存。

    【讨论】:

      猜你喜欢
      • 2018-07-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-05-17
      • 2020-07-25
      • 2021-02-18
      • 2018-10-02
      • 2019-11-15
      相关资源
      最近更新 更多