์๋ ํ์ธ์, matplotlib๋ ์ต๊ทผ Axis์์ ์ ๊ณต ๋ณ์๋ฅผ ์ ๊ฑฐํ ๋ณ๊ฒฝ ์ฌํญ์ ๋ณํฉํ์ต๋๋ค: matplotlib/matplotlib#18769.
matplotlib๋ฅผ html๋ก ๋ณํํ ๋ ์ด ๋ฒ๊ทธ๊ฐ ๋ฐ์ํ์ต๋๋ค.
์ฌ์์ฐ:
import mpld3
import matplotlib.pyplot as plt
fig = plt.figure(1)
ax = plt.plot([1,2,3])
mpld3.fig_to_html(fig)
๊ฒฐ๊ณผ
~/venv/lib/python3.7/site-packages/mpld3/mplexporter/utils.py in get_grid_style(axis)
261 def get_grid_style(axis):
262 gridlines = axis.get_gridlines()
--> 263 if axis._gridOnMajor and len(gridlines) > 0:
264 color = export_color(gridlines[0].get_color())
265 alpha = gridlines[0].get_alpha()
AttributeError: 'XAxis' object has no attribute '_gridOnMajor'
์ฌ๊ธฐ์ ์ ์๋ ์์ ์ฌํญ์ด ์์ต๋๋ค. https://github.com/plotly/plotly.py/issues/2913
@dmiller7115 ์ @carlinmack ์๊ฒ ๊ฐ์ฌ๋๋ฆฝ๋๋ค. ์์ผ๋ก ๋ฉฐ์น ์์ ์ด ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ๋๋ก ๋ ธ๋ ฅํ๊ฒ ์ต๋๋ค. ํ์ธํด์ผ ํ ์ฃผ์ ์ฌํญ์ ์์ ์ด ์ด์ ๋ฒ์ ์ Matplotlib์ ๋ํด ์๋ฌด ๊ฒ๋ ์์์ํค์ง ์๋๋ค๋ ๊ฒ์ ๋๋ค.
์๋ ํ์ธ์ ์ฌ๋ฌ๋ถ, ์ ๋ณด์ ์ ๋ณด ๊ฐ์ฌํฉ๋๋ค.
๋๋ ์ด๊ฒ์ https://github.com/mpld3/mplexporter/compare/2f766e439b9d91ab4d4682245a2360bc1e5c2bb5...be8e3da62c81fea15a0107f3ae96ba16fc2cc9f ์์ ์์ ํ์ต๋๋ค.
@carlinmack์ด ์ ์ํ ์์ ์ฌํญ์ด matplotlib ๋ฒ์ 3.3.3, 3.2.1 ๋ฐ 2.2.5์์ ์๋ํจ์ ํ์ธํ์ต๋๋ค.
์์ ์ฌํญ์ ์ต๋ํ ๋นจ๋ฆฌ ์ ๋ฒ์ ์ ์ถ์ํ๋ ์ฆ์ ์ฌ์ฉํ ์ ์์ต๋๋ค.
๋ฌธ์ ๊ฐ ๋ฐ์ํ๋ฉด ์๋ ค์ฃผ์ธ์!
ํ ์คํธํด ์ฃผ์ ์ ๊ฐ์ฌํฉ๋๋ค! ๋๋ ์ด์ ๋ฒ์ ๊ณผ์ ํธํ์ฑ์ ๋ํด ์๊ฐํ์ง ์์์ง๋ง ์ ์๋ํ๋ค๋ ์์์ ๋ค์ผ๋ ๊ธฐ์ฉ๋๋ค!
https://github.com/mpld3/mpld3/commit/4617a12d7d0cafd636e66bc65a709e2aab22c0e6์ ๋ฆด๋ฆฌ์ค 0.5.2์์ ์์ ๋์์ต๋๋ค!
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
์ฌ๊ธฐ์ ์ ์๋ ์์ ์ฌํญ์ด ์์ต๋๋ค. https://github.com/plotly/plotly.py/issues/2913