<commit_before>======================================================================
Python Matplotlib pm[g
======================================================================

.. contents:: m[gڎ

ړI
==================================================
Matplotlib pbP[W͂ƂĂ[B
葫̂悤ɎgȂ悤ɂȂɂ́AԂvƌB
Python ł͗VтƂɂ񂠂̂
Matplotlib ŖړIg債߂Ȃ悤ɁA܂łł΂ƂړI߂ĂB

lIɂ͎ 2 _ŏ\B

* w̋ȏɂ肪ȋȐOt`悷B
   xy ʏ n XvCȐ`ł΂B

* w̋ȏɂ肪Ȑ`悷B
  ܂ TeX ̊ȈՔłƂėpB

*  PNG 摜܂ PDF t@CƂďo͂B
  ł SVG t@CB

\z
==================================================
.. note::

   ł Python ͎̒ʂB̑͌qB

   * Windows XP Home SP3
   * Python 2.6.6

     * Setuptools 0.6c11
     * NumPy 1.5.0
     * PIL 1.1.6

Matplotlib ̈ˑpbP[WCXg[
--------------------------------------------------
Matplotlib  NumPy 𑽗pĂ̂ŁARɃCXg[ĂB
 :doc:`/python-numpy`

Ƃ͓ɕKvȂB{̂̃CXg[֐iB

Matplotlib {̂CXg[
--------------------------------------------------
C^[lbgڑł͂ ``easy_install`` ŖȂB͂B
::

  $ easy_install -U matplotlib

łȂꍇ́Aڑ egg ȂCXg[[ȂŃrhB
 USB oRăRs[B

CXg[[TCgɂ邩Ȃ̂ŁAɊmFς܂ĂB

ItCł׋ł悤ɃhLgm
--------------------------------------------------
TCg PDF _E[hāA[JfBXNɕۑB
ŏ̃y[W "Matplotlib Release 1.0.0" Ƃ^CgƁA҂̘A
"<NAME>, <NAME>, <NAME>, <NAME>" ĂB
PDF t@CŜ 900 y[Wɋyԑ咘B

ȂA\[XR[hꎮ肵āAɂ Sphinx ɂhLgrh݂A
邮郋[vČǃmłȂƂB

mF
--------------------------------------------------
̂悤ȃR[hsĂ݂āA炵C[WڎŊmFł OK łB

>>> import matplotlib.pyplot as plt
>>> plt.plot([1,2,3,4])
>>> plt.show()

Ō̍s ``plt.show()`` ̌ĂяoJnɁA
PIL  ``Image.show()`` ̂悤Ƀr[[oBꂪȂȂʔB

R[h
==================================================
oĂR[hm[gɎB

TBW

E\z
==================================================
Matplotlib 𗘗p邽߂̊ƍׂĂ݂悤B

:file:`$HOME/.matplotlib/matplotlibrc`
--------------------------------------------------
t@C킩悤ɁAMatplotlib ̃[U[ݒt@CB
hLg̃ZNV 5.1 "The matplotlibrc file" ɏڂLqB

* Windows ł[U[킴킴ϐ ``HOME`` ݒ肵Ăꍇ́A
  Matplotlib ͂Ƃ̃pXQƂĂB

* xł Matplotlib 𗘗pƁA
  ``$HOME`` ɃtH_[ :file:`.matplotlib` łĂB
  ɃeLXgt@C :file:`matplotlibrc` 쐬B

* ev :file:`$PYTHONHOME/lib/site-packages/matplotlib/mpl-data/matplotlibrc` gB

  ev͊{IɐݒR}hH̃RgAEgŖߐsĂB
  𒭂߂Ă΃JX^}CY̕@͒łdg݂ɂȂĂB

* :file:`matplotlibrc`  python-mode ŕҏŴgB

* ``pyplot.plot()``  ``lines.color`` ȂH<commit_msg>* source/python-matplotlib.txt: 主に figure/axes をノート。<commit_after>======================================================================
Python Matplotlib pm[g
======================================================================

.. contents:: m[gڎ

ړI
==================================================
Matplotlib pbP[W͂ƂĂ[B
葫̂悤ɎgȂ悤ɂȂɂ́AԂvƌB
Python ł͗VтƂɂ񂠂̂
Matplotlib ŖړIg債߂Ȃ悤ɁA܂łł΂ƂړI߂ĂB

lIɂ͎ 2 _ŏ\B

* w̋ȏɂ肪ȋȐOt`悷B
   xy ʏ n XvCȐ`ł΂B

* w̋ȏɂ肪Ȑ`悷B
  ܂ TeX ̊ȈՔłƂėpB

*  PNG 摜܂ PDF t@CƂďo͂B
  ł SVG t@CB

\z
==================================================
.. note::

   ł Python ͎̒ʂB̑͌qB

   * Windows XP Home SP3
   * Python 2.6.6

     * Setuptools 0.6c11
     * NumPy 1.5.0
     * PIL 1.1.6

Matplotlib ̈ˑpbP[WCXg[
--------------------------------------------------
Matplotlib  NumPy 𑽗pĂ̂ŁARɃCXg[ĂB
 :doc:`/python-numpy`

Ƃ͓ɕKvȂB{̂̃CXg[֐iB

Matplotlib {̂CXg[
--------------------------------------------------
C^[lbgڑł͂ ``easy_install`` ŖȂB͂B
::

  $ easy_install -U matplotlib

łȂꍇ́Aڑ egg ȂCXg[[ȂŃrhB
 USB oRăRs[B

CXg[[TCgɂ邩Ȃ̂ŁAɊmFς܂ĂB

ItCł׋ł悤ɃhLgm
--------------------------------------------------
TCg PDF _E[hāA[JfBXNɕۑB
ŏ̃y[W "Matplotlib Release 1.0.0" Ƃ^CgƁA҂̘A
"<NAME>, <NAME>, <NAME>, <NAME>" ĂB
PDF t@CŜ 900 y[Wɋyԑ咘B

ȂA\[XR[hꎮ肵āAɂ Sphinx ɂhLgrh݂A
邮郋[vČǃmłȂƂB

mF
--------------------------------------------------
̂悤ȃR[hsĂ݂āA炵C[WڎŊmFł OK łB

>>> import matplotlib.pyplot as plt
>>> plt.plot([1,2,3,4])
>>> plt.show()

Ō̍s ``plt.show()`` ̌ĂяoJnɁA
PIL  ``Image.show()`` ̂悤Ƀr[[oBꂪȂȂʔB

R[h
==================================================
oĂR[hm[gɎB

̕ ``plt`` 
``import matplotlib.pyplot as plt`` ƕʖ`̂ƂB

{IȊ֐E\bh
--------------------------------------------------
̕\Ăwv𓖂B

===============        ==============================================
֐                   d
===============        ==============================================
``plt.plot()``         Ot`
``plt.hist()``         qXgO`

``plt.show()``         C[WCɕ\
``plt.setp()``         vbg̑A`p[^[̎擾Ew

``plt.axis()``         r[|[g͈͎w
``plt.grid()``         Obh`邩Ȃw
===============        ==============================================

Figures and Axes
~~~~~~~~~~~~~~~~~~~~
Matplotlib ɂ current figure  current axes ƂTOB
𗘗pāÃOtV[ɒ`ł悤B

=================        ==============================================
֐                     d
=================        ==============================================
``plt.figure()``         w figure Jgɂ
``plt.subplot()``        w axes Jgɂ
=================        ==============================================

* Figure ƂAɏoĂ}ĩCX^XjƉ߂B

* ʂ͈̐}ɃOtڂ킯A
  悤ȃOtׂ̂̐}ƂꍇB
  Axes ƂꂪӖ̂ÃOtƉ߂΂悢B

* ``plt.figure(n)``  current figure w肷B
* ``plt.subplot(n0n1n2)``  current axes w肷B
  ``n0``, ``n1``, ``n2`` ꂼc̋搔A̋搔A
  uǂ̋悩vӖB

  ``n2``  1 ȏ ``n1 * n2`` ȉ̒lłȂ΂ȂȂB

  TODO: ɃTvR[hƐ}B

* ``plt`` ̃vbgR}hׂ͂ current axes ɍpB

Matplotlib  figure/axes X^C񋟂ĂB

* ÓTIȃXe[g}V𑀍삷C[ŴB

  [U[R[hJg figure/axes ł邩ɈӎāAvbgR}hĂяoB
  R}h̓Jg figure/axes ɑ΂ēKp邱ƂɂȂB

* ԂƃIuWFNgƂтĎ舵T^IȃIuWFNgwvO~ÔB

  figure/axes IuWFNgɂȂĂāA\bhŃvbgR}hĂяoB
  R}h͑ΏۂƂȂIuWFNg̊Ǘ figure/axes ɑ΂ēKp邱ƂɂȂB

eLXg
~~~~~~~~~~~~~~~~~~~~
ŏIړIƂĂ̓vbgɂOt`킯ȂOɃeLXgwKB

=================        ==============================================
֐                     d
=================        ==============================================
``plt.text()``           r[|[gɃeLXg`
``plt.xlabel()``         X pLvV
``plt.ylabel()``         Y pLvV
``plt.title()``          OtŜ̃LvV
=================        ==============================================

* ``plt.text()`` ͎wʒuɃeLXg`悷R}hƍlB
* 肪Ƃ TeX ̐󂯕tĂB
  ̓obNXbV̗ɂȂ邱Ƃ\zł̂ŁAraw string `Ŏw肷̂gB
  ::

    plt.text(60, .025, r'$\mu=100,\ \sigma=15$')

E\z
==================================================
Matplotlib 𗘗p邽߂̊ƍׂĂ݂悤B

:file:`$HOME/.matplotlib/matplotlibrc`
--------------------------------------------------
t@C킩悤ɁAMatplotlib ̃[U[ݒt@CB
hLg̃ZNV 5.1 "The matplotlibrc file" ɏڂLqB

* Windows ł[U[킴킴ϐ ``HOME`` ݒ肵Ăꍇ́A
  Matplotlib ͂Ƃ̃pXQƂĂB

* xł Matplotlib 𗘗pƁA
  ``$HOME`` ɃtH_[ :file:`.matplotlib` łĂB
  ɃeLXgt@C :file:`matplotlibrc` 쐬B

* ev :file:`$PYTHONHOME/lib/site-packages/matplotlib/mpl-data/matplotlibrc` gB

  ev͊{IɐݒR}hH̃RgAEgŖߐsĂB
  𒭂߂Ă΃JX^}CY̕@͒łdg݂ɂȂĂB

* :file:`matplotlibrc`  python-mode ŕҏŴgB

* ``pyplot.plot()``  ``lines.color`` ȂH
{'fraction_non_alphanumeric': 0.41648556348959953, 'fraction_numerical': 0.013039428748835765, 'mean_word_length': 2.9894736842105263, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5368379', 'n_tokens_mistral': 3572, 'n_tokens_neox': 3454, 'n_words': 422}