1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

matplotlib(pyplot)でグラフをPDFで保存したら真っ白だった話

Last updated at Posted at 2021-09-19

問題発生

以下のプログラムでPDFを保存した
そのPDFを見たら、、、真っ白、、、
わずかスプーン1杯で驚きの白さに!!!

qiita.rb
import matplotlib.pyplot as plt
省略
plt.show()
plt.savefig("test.pdf")#グラフを保存

解決方法

qiita.rb
import matplotlib.pyplot as plt
省略
plt.savefig("test.pdf")#グラフを保存
plt.show()

一番下の2行の順番を変えただけ
plt.show()の後にplt.savefig()をやったらだめなのね

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?