matplotlibで円をプロットしようとしていますが、結果は常に空のプロットです。Matplotlibプロットが空白になる
など。
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
import matplotlib.collections as mcollections
fig = plt.figure()
fig.set_size_inches(18.5, 10.5, forward=True)
ax = fig.add_subplot(111, aspect='equal')
x = np.array([17., 29., 41., 3., 15.])
y = np.array([21., 41., 30., 19., 5.])
r = np.array([22.8035085, 46.04345773, 46.61544808, 16., 12.16552506])
patches = [mpatches.Circle((xx, yy), rr) for xx, yy, rr in zip(x, y, r)]
collection = mcollections.PatchCollection(patches)
ax.add_collection(collection)
fig.savefig("test.png")
これは、add_artistを試したときと同じように、空のプロットを生成します。うまくいけば、誰かが私が間違っているところへ私を向けることができます!ありがとうございました
同じ問題になります:私の答えよりも良い、http://stackoverflow.com/questions/42875357/deformed-rectangulars-with-decreasing-trend – ImportanceOfBeingErnest