matplotlib ã PyQt ãããªã㦠PySide ã§åãã㦠PyQt ç¬ç¹ã®é¢å極ã¾ããªãã¤ã³ã¹ãã¼ã«ããéæ¾ããã
ãªãã pip install
ã® --no-install
ã¨ã --no-download
ãªãã·ã§ã³ã DEPRECATED ã«ãªã£ãã PyPI ãã PyQt4 ããã¦ã³ãã¼ãã§ããªããªã£ãããããããå¤åãã¦ã¾ãããææ«ã§ãã
ã©ããããªãã ã®è¨äºãæ¸ãã¨ãã«è¡ã£ãç°å¢æ´çã§ééã㦠matplotlib æ¶ãã¡ãã£ããããªã®ã§ã¤ã³ã¹ãã¼ã«ãããªããã¦ãã¾ããã matplotlib ã¯çããããåç¥ã®éã Python ããã°ã©ããæãããã®ã©ã¤ãã©ãªã§ã ç§å¦å¦ç系㧠Python ã使ã£ã¦ããåã«ã¯ãªãã¦ã¯ãªããªãã©ã¤ãã©ãªã§ãã ããã¤ã¯æç»é¢ä¿ã« PyQt ã¨ãã Python ãã Qt ã使ãããã®ã©ã¤ãã©ãªãè¦æ±ãããã§ããï¼ã¨ãããåãããã使ãããããè¦æ±ãã¦ãã ãã©ï¼ PyQt ã¯æããã¤ã³ã¹ãã¼ã«ãå²ã¨é¢åã§ãã ãªã®ã§å㯠OS ã®ããã±ã¼ã¸ããã¼ã¸ã£çã使ã£ã¦ããã®ã§ãããããªè¨äºãæ¸ãã¡ãã£ããã¨ã§ãã pyenv ã«å ¥ãããã¨ã«ãã¾ããã ã¨ãããåé ã«ãæ¸ãã¾ããã PyPI ãã PyQt4 ãã¦ã³ãã¼ãã§ããªããªã£ã¦ãã pip ã§ã©ã¤ãã©ãªããã¦ã³ãã¼ãããã³ãã³ãã¯æ´åä¸ã¿ããã ãï¼refactor --no-install/--no-download/--download (and use mkdtemp build dirs) #906ï¼ã£ã¦ãã¨ã§é¢åããããªã£ãã®ã§ PyQt ã®ä»£ããã« PySide ã使ããã¨ã«ãã¾ããã
PySide
PySide ã¯å²ã¨æ´»çºã«éçºããã¦ãã PyQt ã® Alternative ã§ããã PyQt ã GPL (GNU General Public License) ãªã®ã«å¯¾ã PySide 㯠LGPL (GNU Lesser General Public License) ã¨ãã大ããªã©ã¤ã»ã³ã¹ã®éããããã¾ãã Qt ã LGPL ã§ä½¿ããã¨ããå¬ããé¢ã®ä»ã«ããæ°è¦éçºã§ããããã«å é¨æ§æãç¾ãããªã£ã¦ããç¹ãã¤ã³ã¹ãã¼ã«ãç°¡åãªç¹ãªã©ãããã®ã§ãå人çã« Python ãã Qt ã使ãå ´åã¯å¤§æµãã¡ããé¸ãã§ãã¾ãï¼ãã ãä¸é¨æ©è½ã«ã¤ãã¦ã¯ PyQt ã®ã»ããé«æ©è½ã§ PySide ãããã«è¿½å¾ããåªåããã¦ãã段éã§ãï¼ã
Install & Configure
ã¨ããããã¤ã³ã¹ãã¼ã«ã¯ã»ã¼ä½ãèããªãã¦ãåé¡ããã¾ããã
ä¸ã¤æ³¨æãå¿
è¦ãªã®ã¯ PySide ã®ã»ããã¢ããã¹ã¯ãªããã§ããã¥ã¡ã³ãããã«ãããé¨åãããã®ã§ããããã«ãã« Sphinx ã使ã£ã¦ãã¾ããããinstall_require
ã«æå®ããã¦ããªããããªã®ã§ããããªãã¨ã³ã±ã¾ãããªã®ã§ Sphinx 㨠PySide ã®ã¤ã³ã¹ãã¼ã«é çªã¯æ°ãã¤ãã¾ãããã
ãããã¨ã¡ãªã¿ã« numpy ã matplotlib ã pyside ãããããªã©ã¤ãã©ãªãè¦æ±ããã®ã§ãæããããé å¼µã£ã¦ã¤ã³ã¹ãã¼ã«ãã¾ãããã
$ pip install numpy matplotlib sphinx $ pip install pyside
ã¨ããããåé¡ãªããã¹ã¦ã¤ã³ã¹ãã¼ã«ãçµãã£ãã¨ä»®å®ãã¾ãã
ã§ããã®ã¾ã¾ã 㨠matplotlib ããã PyQt ãæ¢ãã«è¨ã£ã¦ãã¾ãã®ã§ Linux 㯠~/.config/matplotlib/matplotlibrc
ãMac 㯠~/.matplotlib/matplotlibrc
ã«ä¸è¨ã®ããã«è¨è¼ãã¦ãã ããã
backend : qt4agg backend.qt4 : PySide
ããã§åãããã«ãªãã¯ãã§ãã ã¡ãªã¿ã«ãã®ãã¡ã¤ã«ã«ã¯ä»ã«ãè²ã ãªè¨å®ãã§ããã®ã§ãæ°ã«ãªã人ã¯Customizing matplotlibããã§ãã¯ãã¦ãã ããã å ¨ã¦ãçµããã°ä¸è¨ã®ãã¹ãç¨ããã°ã©ã ãåãã¯ãã§ãã
import numpy as np import matplotlib.pyplot as pl x = np.linspace(-np.pi, np.pi, 201) y = np.sin(x) pl.plot(x, y) pl.xlabel('Angle [rad]') pl.ylabel('sin(x)') pl.axis('tight') pl.show()
Good luck!