pythonのmatplotlibを用いて、極座標においてプロットを行うと、
タイトルとメモリが次の画像のように重なってしまいます。
公式ドキュメント(https://matplotlib.org/users/tight_layout_guide.html)に従って
fig.tight_layout()を追加してみたのですが、タイトルとメモリは重なったままです。
改善方法のわかる方がいらっしゃったらご教示ください。
pythonのバージョンはPython 3.6.8 :: Anaconda, Inc.です。
matplotlibのバージョンは3.1.0です。
import math import numpy as np import matplotlib.pyplot as plt plt.rcParams["xtick.labelsize"] = 22 plt.rcParams["ytick.labelsize"] = 22 plt.rcParams["axes.labelsize"] = 28 plt.rcParams['legend.fontsize'] = 20 plt.rcParams["figure.autolayout"] = True plt.rcParams["axes.titlesize"] = 25 plt.rcParams['font.family'] = 'sans-serif' plt.rcParams['font.sans-serif'] = ['Arial'] plt.rcParams['xtick.direction'] = 'in' plt.rcParams['ytick.direction'] = 'in' plt.rcParams["legend.fancybox"] = False plt.rcParams["legend.edgecolor"] = 'black' npts = 100 # number of points in [0, 2*pi) range of angle angles = 2*math.pi/(npts-1)*np.arange(npts) fig = plt.figure() ax = fig.add_subplot(111, projection='polar') ax.set_rmax(1) ax.set_rticks([0,0.5,1]) ax.grid(True) ax.set_rlabel_position(22) ax.tick_params(pad=25) ax.set_title("title") fig.tight_layout() plt.savefig("test") ax.clear() plt.clf()
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/07/01 13:57