{"cells":[{"cell_type":"markdown","metadata":{"id":"rU_od4vgJayo"},"source":["# matplotlib tutorial (3) nitta@tsuda.ac.jp\n","\n","# Chapter 3: Using Japanese Font\n","\n","
    \n","
  1. Download and unzip the Japanese Font, IPAex, distributed by IPA.
  2. \n","
  3. Place ipaexg.ttf in the font folder of matplotlib.
  4. \n","
  5. Delete the cache file of font.
  6. \n","
  7. Restart the runtime.
  8. \n","
  9. Set to read ipaexg.ttf in the setting file, matplotlibrc, of matplotlib. \n","Specify plt.rcParams['font.family'] = 'IPAexGothic' in the python program.
  10. \n","
"]},{"cell_type":"markdown","metadata":{"id":"Q9mVIntuTLT3"},"source":["## 3-1: Download and expand Japanese font.\n","\n","There are several versions of the IPAex font.\n","The latest version at the moment (2022/03/25) is Ver.004.01.\n","\n","\n","https://moji.or.jp/ipafont/ipaex00401/\n","\n","\n","This time, IPAex Gothic \"ipaexg00401.zip\" to download.\n","\n","Official URL:\n","\n","https://moji.or.jp/wp-content/ipafont/IPAexfont/ipaexg00401.zip\n","\n","\n","mirror: \n","\n","http://nw.tsuda.ac.jp/python/matplotlib/ipaexg00401.zip\n","\n","\n"]},{"cell_type":"code","execution_count":1,"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"executionInfo":{"elapsed":950,"status":"ok","timestamp":1657425228194,"user":{"displayName":"Yoshihisa Nitta","userId":"15888006800030996813"},"user_tz":-540},"id":"-JTtt0pNUxcR","outputId":"ed9aabc7-0660-4cf7-9b7c-57cf1546eef0"},"outputs":[{"output_type":"stream","name":"stdout","text":["--2022-07-10 03:53:47-- https://moji.or.jp/wp-content/ipafont/IPAexfont/ipaexg00401.zip\n","Resolving moji.or.jp (moji.or.jp)... 157.7.44.215\n","Connecting to moji.or.jp (moji.or.jp)|157.7.44.215|:443... connected.\n","HTTP request sent, awaiting response... 200 OK\n","Length: 4166255 (4.0M) [application/zip]\n","Saving to: ‘ipaexg00401.zip’\n","\n","ipaexg00401.zip 100%[===================>] 3.97M 12.9MB/s in 0.3s \n","\n","2022-07-10 03:53:47 (12.9 MB/s) - ‘ipaexg00401.zip’ saved [4166255/4166255]\n","\n","Archive: ipaexg00401.zip\n"," creating: ipaexg00401/\n"," inflating: ipaexg00401/ipaexg.ttf \n"," inflating: ipaexg00401/IPA_Font_License_Agreement_v1.0.txt \n"," inflating: ipaexg00401/Readme_ipaexg00401.txt \n"]}],"source":["FNAME = 'ipaexg00401.zip'\n","URL = f'https://moji.or.jp/wp-content/ipafont/IPAexfont/{FNAME}'\n","# URL = f'http://nw.tsuda.ac.jp/python/matplotlib/{FNAME}'\n","\n","import os\n","if os.name != 'nt':\n"," ! wget {URL}\n"," ! unzip {FNAME}\n","else:\n"," import urllib.request\n"," import zipfile\n"," urllib.request.urlretrieve(URL, FNAME)\n"," with zipfile.ZipFile(FNAME, 'r') as f:\n"," f.extractall('.')"]},{"cell_type":"code","execution_count":2,"metadata":{"id":"c_WvNO1gPDR7","executionInfo":{"status":"ok","timestamp":1657425228194,"user_tz":-540,"elapsed":5,"user":{"displayName":"Yoshihisa Nitta","userId":"15888006800030996813"}}},"outputs":[],"source":["# resolve OS dependencies by nitta\n","if os.name == 'nt':\n"," LS = 'dir /w'\n"," LS_L = 'dir'\n"," LS_LR = 'dir /s'\n"," RM_RF = 'rmdir /S /Q'\n"," CP = 'copy'\n","else:\n"," LS = 'ls'\n"," LS_L = 'ls -al'\n"," LS_LR = 'ls -lR'\n"," RM_RF = 'rm -rf'\n"," CP = 'cp'"]},{"cell_type":"markdown","metadata":{"id":"8P26SiN-NzE3"},"source":["## 3-2: Examine the folder that stores the font.\n","\n","Folders for storing fonts vary from system to system.\n","The example code below is run on Google Colab.\n","\n","If you install Anaconda to the path \"D:\\sys\\Anaconda3\" on Windows,\n","here is an example of running jupyter notebook with the python virtual\n","environment as \"book3\".
\n","\n","\n","'D:\\\\sys\\\\Anaconda3\\\\envs\\\\book3\\\\lib\\\\site-packages\\\\matplotlib\\\\mpl-data\\\\matplotlibrc'\n"]},{"cell_type":"code","execution_count":3,"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"executionInfo":{"elapsed":6,"status":"ok","timestamp":1657425228195,"user":{"displayName":"Yoshihisa Nitta","userId":"15888006800030996813"},"user_tz":-540},"id":"8qAUsdxCJPG0","outputId":"f3966e9a-145e-4c4c-8dd2-14eee430801c"},"outputs":[{"output_type":"stream","name":"stdout","text":["/usr/local/lib/python3.7/dist-packages/matplotlib/mpl-data/matplotlibrc\n"]}],"source":["# sample code 3-1\n","import matplotlib\n","\n","tmp = matplotlib.matplotlib_fname() \n","print(tmp)"]},{"cell_type":"code","execution_count":4,"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"executionInfo":{"elapsed":409,"status":"ok","timestamp":1657425228601,"user":{"displayName":"Yoshihisa Nitta","userId":"15888006800030996813"},"user_tz":-540},"id":"_-EivsLLS_MQ","outputId":"40934010-9d14-49d1-c091-8b9c8e447ac8"},"outputs":[{"output_type":"stream","name":"stdout","text":["cmb10.ttf\t\t\tDejaVuSerif.ttf\n","cmex10.ttf\t\t\tLICENSE_DEJAVU\n","cmmi10.ttf\t\t\tLICENSE_STIX\n","cmr10.ttf\t\t\tSTIXGeneralBolIta.ttf\n","cmss10.ttf\t\t\tSTIXGeneralBol.ttf\n","cmsy10.ttf\t\t\tSTIXGeneralItalic.ttf\n","cmtt10.ttf\t\t\tSTIXGeneral.ttf\n","DejaVuSans-BoldOblique.ttf\tSTIXNonUniBolIta.ttf\n","DejaVuSans-Bold.ttf\t\tSTIXNonUniBol.ttf\n","DejaVuSansDisplay.ttf\t\tSTIXNonUniIta.ttf\n","DejaVuSansMono-BoldOblique.ttf\tSTIXNonUni.ttf\n","DejaVuSansMono-Bold.ttf\t\tSTIXSizFiveSymReg.ttf\n","DejaVuSansMono-Oblique.ttf\tSTIXSizFourSymBol.ttf\n","DejaVuSansMono.ttf\t\tSTIXSizFourSymReg.ttf\n","DejaVuSans-Oblique.ttf\t\tSTIXSizOneSymBol.ttf\n","DejaVuSans.ttf\t\t\tSTIXSizOneSymReg.ttf\n","DejaVuSerif-BoldItalic.ttf\tSTIXSizThreeSymBol.ttf\n","DejaVuSerif-Bold.ttf\t\tSTIXSizThreeSymReg.ttf\n","DejaVuSerifDisplay.ttf\t\tSTIXSizTwoSymBol.ttf\n","DejaVuSerif-Italic.ttf\t\tSTIXSizTwoSymReg.ttf\n"]}],"source":["import os\n","dpath, fname = os.path.split(tmp)\n","\n","fontpath = os.path.join(dpath, 'fonts', 'ttf')\n","! {LS} {fontpath}"]},{"cell_type":"code","execution_count":5,"metadata":{"id":"JT6iDMk0gEp7","executionInfo":{"status":"ok","timestamp":1657425228603,"user_tz":-540,"elapsed":7,"user":{"displayName":"Yoshihisa Nitta","userId":"15888006800030996813"}}},"outputs":[],"source":["SRC = os.path.join('ipaexg00401', 'ipaexg.ttf')\n","! {CP} {SRC} {fontpath}"]},{"cell_type":"markdown","metadata":{"id":"pSVq4AnTg06I"},"source":["## 3-3: Delete the font cache.\n","\n","With Google Colab, find the location of the font cache by matplotlib.get_cachedir().\n","What should be deleted is the fontlist-vXXX.json file, but since it is troublesome, we will delete the entire folder this time.\n"]},{"cell_type":"code","execution_count":6,"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"executionInfo":{"elapsed":411,"status":"ok","timestamp":1657425235260,"user":{"displayName":"Yoshihisa Nitta","userId":"15888006800030996813"},"user_tz":-540},"id":"dxwECA8Gk2eX","outputId":"548ae638-43f5-4a4c-f9a7-6167c84c1cf6"},"outputs":[{"output_type":"stream","name":"stdout","text":["/root/.cache/matplotlib\n","total 44\n","drwxr-xr-x 3 root root 4096 Jul 6 13:32 .\n","drwxr-xr-x 1 root root 4096 Jul 7 13:19 ..\n","-rw-r--r-- 1 root root 29337 Jul 6 13:32 fontlist-v310.json\n","drwxr-xr-x 2 root root 4096 Jul 6 13:32 tex.cache\n"]}],"source":["# font cache path\n","import matplotlib\n","cache_path = matplotlib.get_cachedir()\n","print(cache_path)\n","\n","! {LS_L} {cache_path}\n","! {RM_RF} {cache_path}"]},{"cell_type":"markdown","metadata":{"id":"_aCpnNW6lr0q"},"source":["Windows や Mac の Anaconda で jupyter を動作させている場合は、フォントキャッシュはmatplotlib.get_configdir() の下の\n","fontlist-vXXX.json である。"]},{"cell_type":"markdown","metadata":{"id":"UuraWMOJj8Vn"},"source":["## 3-4: Restart the runtime.\n","\n","For Google Colab:\n","Runtime → Restart Runtime.\n","\n","For jupyter notebook on local PC:\n","Kernel → Restart.\n"]},{"cell_type":"markdown","metadata":{"id":"RqCGTqiqhbIB"},"source":["## 3-5: Use matplotlib by specifying font.family.\n","\n","Immediately after restarting runtime, Execute the next cell."]},{"cell_type":"code","execution_count":1,"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":401},"executionInfo":{"elapsed":16,"status":"ok","timestamp":1657425260696,"user":{"displayName":"Yoshihisa Nitta","userId":"15888006800030996813"},"user_tz":-540},"id":"IDDZnE9DN_30","outputId":"a5078859-75ca-419f-e66a-c72eaa94c900"},"outputs":[{"output_type":"display_data","data":{"text/plain":["
"],"image/png":"iVBORw0KGgoAAAANSUhEUgAAAfgAAAGACAYAAABBWXDTAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAZW0lEQVR4nO3dfbRddX3n8fcHQnzAqEwIpoo8jAulIuiSK0J9GOqSQlEwgKKtCkrb+FAfp4qO44wPqYzjAisVpYnUpxqK1lSoiFKrBqQYshJlFB/WWF1WHUMMVSKoCJXv/LF37Mkluffm5u6b5Hffr7VY3LP3Oft+71533Xf2Ofvsk6pCkiS1Za9dPYAkSZp5Bl6SpAYZeEmSGmTgJUlqkIGXJKlBBl5qVJLXJ3nVrp5jiyQv253mkVo3b1cPIGliSdYA9wfuHL8KeEBVHTLN7a4EHtbffBXwOuC3gCOAr/fLv1NVzx33uMcBrwUeCewL/AD4Av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22e433JAv7yx9LmiWDfh68pF3ud4DfB44C3gx8OcnDgYfTXYxkMXBxVW0GSPIPwIPHbePSqnrnRN8kybPp3tP/1aq6bGT5q4Gb6C5d+kzgZTPyU0malIGX2ncisD/wFOCbdFdy+1u6K2MdBuwHbAaoqlOnssEkDwA+BXwP+GO6S2cexz0vIrM/sA9d4CXNIgMvNSTJ64H7VNWbklwIfBm4ju5KY/8ILAB+BfwMuC8jH7yS5C/pPqFxvIcBz6qq1f397g1cTndxkwXAZ4AzgDX9B0CN2he4nXEvByZZ0F+ERtJADLzUlncAVyV5JXB/4P/RfVDFbwH/QncN66OB+9DFdz/gEoCqesX4jSWZD6ynu3Ik/aUyLwf+vqo+0S/7N+DzwPOAr43bxEOAHwEHjmzz/sDnkpxUVf82Iz+1pHsw8FJDquruJG+lO2o/lO4p8lOB36aL+zvpgv3B/vbhk2zyDcBHquoX/e1D6OL+npHv+akkG4GPJ3lnVS2H3xzpPxL4Dn3g+38g/C2wzLhLw/IseqkhSfah+2jUc+hifjBd7H/c/3/RFLezV5Jz6U7Oe8eW5VX1tdG4jyxfBzwJeHySe/WLlwEr6j+uh/0I4AvAh6rKD4iSBuYRvNSWt9EdYX8wyaOBA6rqjUkOqao3AiT5c7oj6/l0T9NfMrqBJC8Hnkv3mv2zaoofWFFVP6b7hwVJnkb39P/r+tXfB+4Enl1V39nJn1HSFPhhM9IckOQjVfW8bXz958AlVfW9kfueBKyrqlt2ybCSZoSBl+aYJPtUlW9bkxpn4CVJapAn2UmS1CADL0lSgwy8JEkNMvCSJDXIwEuS1CADL0lSg/4/Uc7Cy7jXZbwAAAAASUVORK5CYII=\n"},"metadata":{"needs_background":"light"}}],"source":["# sample code 3-5\n","%matplotlib inline\n","import matplotlib.pyplot as plt\n","import numpy as np\n","\n","plt.rcParams['font.family'] = 'IPAexGothic'\n","\n","fig, ax = plt.subplots(1,1,figsize=(8,6))\n","ax.set_title('日本語の表示')\n","ax.set_xlabel('x軸ラベル')\n","ax.set_ylabel('y軸ラベル')\n","\n","plt.show()"]},{"cell_type":"code","source":[""],"metadata":{"id":"NYv5El0cPmre"},"execution_count":null,"outputs":[]}],"metadata":{"colab":{"collapsed_sections":[],"name":"matplotlib_tutorial_03_en.ipynb","provenance":[]},"kernelspec":{"display_name":"Python 3","language":"python","name":"python3"},"language_info":{"codemirror_mode":{"name":"ipython","version":3},"file_extension":".py","mimetype":"text/x-python","name":"python","nbconvert_exporter":"python","pygments_lexer":"ipython3","version":"3.6.13"}},"nbformat":4,"nbformat_minor":0}