{"id":938,"date":"2019-11-27T14:29:16","date_gmt":"2019-11-27T05:29:16","guid":{"rendered":"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/?p=938"},"modified":"2019-11-27T14:44:26","modified_gmt":"2019-11-27T05:44:26","slug":"python-matplotlib-%e3%81%a7%e6%97%a5%e6%9c%ac%e8%aa%9e%e8%a1%a8%e7%a4%ba","status":"publish","type":"post","link":"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/938\/","title":{"rendered":"Python matplotlib \u3067\u65e5\u672c\u8a9e\u8868\u793a"},"content":{"rendered":"<p>Windows, macOS, Ubuntu (Linux) \u5171\u306b\uff0c\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u3066 matplotlibrc \u306e\u5c45\u5834\u6240\u3092\u63a2\u3057\u51fa\u3057\u3066\uff0cfont.serif: \u3068 font.sans-serif: \u306b\u65e5\u672c\u8a9e\u30d5\u30a9\u30f3\u30c8\u540d\u3092\u633f\u5165\u3059\u308b\u3002<\/p>\n<pre>&gt;&gt;&gt; import matplotlib as mpl\r\n&gt;&gt;&gt; mpl.matplotlib_fname()<\/pre>\n<p>matplotlibrc \u306e\u4ee5\u4e0b\u306e\u90e8\u5206\u3092\u5909\u66f4\u3059\u308b\u3002<\/p>\n<pre># font.serif :\u00a0 DejaVu Serif, \u2026\r\n# font.sans-serif : DejaVu Sans, \u2026<\/pre>\n<h3>Windows \u306e\u5834\u5408<\/h3>\n<p><code>choco install -y python --version=3.7.5<\/code> \u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u5834\u5408\uff0c<\/p>\n<p><code>C:\u00a5Python37\u00a5lib\u00a5site-packages\u00a5matplotlib\u00a5mpl-data\u00a5matplotlibrc<\/code> \u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3002<\/p>\n<pre>font.serif : Yu Mincho, DejaVu Serif, \u2026\r\nfont.sans-serif : Yu Gothic, DejaVu Sans, \u2026<\/pre>\n<p>\u307e\u305f\uff0c<a href=\"https:\/\/www.google.com\/get\/noto\/\">Google Noto Fonts<\/a> \u304b\u3089Noto Sans CJK JP \u3068 Noto Serif CJK JP \u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u3089\uff0c<\/p>\n<pre>font.serif : Noto Serif CJK JP, DejaVu Serif, \u2026\r\nfont.sans-serif : Noto Sans CJK JP, DejaVu Sans, \u2026<\/pre>\n<p>\u3068\u3057\u3066\u3082\u3088\u3044\u304b\u3082\u3057\u308c\u306a\u3044\u3002<\/p>\n<h3>macOS \u306e\u5834\u5408<\/h3>\n<p><code>brew install python<\/code> \u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u5834\u5408\uff0c\u3064\u3044\u3067\u306b<br \/>\n<code>brew cask install font-noto-sans-cjk-jp font-noto-serif-cjk-jp<\/code> \u3057\u3066\uff0c<\/p>\n<p><code>\/usr\/local\/lib\/python3.7\/site-packages\/matplotlib\/mpl-data\/matplotlibrc<\/code> \u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3002<\/p>\n<pre>font.serif : Noto Serif CJK JP, DejaVu Serif, \u2026\r\nfont.sans-serif : Noto Sans CJK JP, DejaVu Sans, \u2026<\/pre>\n<p>\u306a\u304a\uff0c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f Noto \u30d5\u30a9\u30f3\u30c8\u306f ~\/Library\/Fonts\/ \u306b\u5165\u308b\u306e\u3067\uff0c\u7ba1\u7406\u8005\u6a29\u9650\u3067 \/Library\/Fonts\/ \u30d5\u30a9\u30eb\u30c0\u306b\u79fb\u52d5\u3059\u308b\u3068\uff0c\u5168\u3066\u306e\u30e6\u30fc\u30b6\u304c\u4f7f\u3048\u308b\u3088\u3046\u306b\u306a\u308b\u304b\u3068\u601d\u308f\u308c\u308b\u3002<\/p>\n<h3>Ubuntu (18.04) \u306e\u5834\u5408<\/h3>\n<p>Noto \u30d5\u30a9\u30f3\u30c8\u306f\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6e08\u307f\u3060\u3068\u601d\u3046\u306e\u3067\uff0c<code>matplotlibrc<\/code> \u3092\u63a2\u3057\u51fa\u3057\u3066\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3002<\/p>\n<pre>font.serif : Noto Serif CJK JP, DejaVu Serif, \u2026\r\nfont.sans-serif : Noto Sans CJK JP, DejaVu Sans, \u2026<\/pre>\n<h3>Visual Studio Code \u3067\u306e\u8868\u793a\u4f8b<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-942\" src=\"http:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/mpl-noto-fonts-640x796.png\" alt=\"\" width=\"640\" height=\"796\" srcset=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/mpl-noto-fonts-640x796.png 640w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/mpl-noto-fonts-300x373.png 300w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/mpl-noto-fonts-768x955.png 768w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/mpl-noto-fonts-217x270.png 217w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/mpl-noto-fonts.png 908w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Windows, macOS, Ubuntu (Linux) <a href=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/938\/\" class=\"read-more\">Read More &#8230;<\/a><\/p>\n","protected":false},"author":33,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[7,11,12,4],"tags":[],"class_list":["post-938","post","type-post","status-publish","format-standard","hentry","category-macos","category-python","category-ubuntu","category-windows"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-json\/wp\/v2\/posts\/938","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-json\/wp\/v2\/users\/33"}],"replies":[{"embeddable":true,"href":"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-json\/wp\/v2\/comments?post=938"}],"version-history":[{"count":4,"href":"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-json\/wp\/v2\/posts\/938\/revisions"}],"predecessor-version":[{"id":943,"href":"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-json\/wp\/v2\/posts\/938\/revisions\/943"}],"wp:attachment":[{"href":"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-json\/wp\/v2\/media?parent=938"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-json\/wp\/v2\/categories?post=938"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-json\/wp\/v2\/tags?post=938"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}