{"id":453,"date":"2024-12-31T20:41:16","date_gmt":"2024-12-31T11:41:16","guid":{"rendered":"https:\/\/www.flumen-jp.com\/wordpress\/?p=453"},"modified":"2025-01-10T18:23:07","modified_gmt":"2025-01-10T09:23:07","slug":"usetex","status":"publish","type":"post","link":"https:\/\/www.flumen-jp.com\/wordpress\/index.php\/2024\/12\/31\/usetex\/","title":{"rendered":"matplotlib \u3067 latex"},"content":{"rendered":"\n<p>\u2003\u4eca\u56de\u306f\u4e0b\u56f3\u306e\u3088\u3046\u306b matplotlib \u3067 latex \u3092\u4f7f\u3046\u3068\u3044\u3046\u30f2\u30bf\u30af\u306a\u8a71\u984c\u3067\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"480\" src=\"https:\/\/www.flumen-jp.com\/wordpress\/wp-content\/uploads\/2024\/12\/extream.png\" alt=\"\" class=\"wp-image-454\" srcset=\"https:\/\/www.flumen-jp.com\/wordpress\/wp-content\/uploads\/2024\/12\/extream.png 640w, https:\/\/www.flumen-jp.com\/wordpress\/wp-content\/uploads\/2024\/12\/extream-300x225.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/figure>\n\n\n\n<p>\u2003\u4e0a\u56f3\u306e\u63cf\u753b\u90e8\u306e\u30b3\u30fc\u30c9\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-python\" data-lang=\"Python\"><code>def can_usetex():\n    path = os.environ[&#39;PATH&#39;]\n    paths = path.split(os.pathsep)\n    for p in paths:\n        f = os.path.join(p, &#39;latex.exe&#39;)\n        if os.path.isfile(f):\n            return True\n    return False\n\ndef show_figure():\n    if can_usetex():\n        plt.rcParams[&quot;text.usetex&quot;] = True\n        plt.rcParams[&quot;text.latex.preamble&quot;] = &quot;\\\\usepackage{amsmath,bm}&quot;\n        plt.rcParams[&quot;font.family&quot;] = &quot;serif&quot;\n        plt.rcParams[&quot;font.size&quot;] = 15\n            :\n    plt.xlabel(&#39;$x$ (mm)&#39;)\n    plt.ylabel(&#39;$-\\\\log_e(-\\\\log_e \\\\! F)$&#39;)\n    plt.text(x1, y1, &#39;260.0&#39;, horizontalalignment=&#39;center&#39;,\n\u3000\u3000    bbox=bbox, rotation=90)\n    plt.text(x2, y2, &#39;$F=1-1\/100$&#39;, horizontalalignment=&#39;center&#39;,\n        bbox=bbox)\n    plt.text(x3, y3, str_formula, horizontalalignment=&#39;center&#39;,\n        bbox=bbox)\n            :<\/code><\/pre><\/div>\n\n\n\n<p>\u2003\u30b5\u30fc\u30c1\u30d1\u30b9\u4e0a\u306b latex.exe \u304c\u5b58\u5728\u3059\u308b\uff08can_use \u95a2\u6570\u306e\u623b\u308a\u5024\u304c\u771f\uff09\u5834\u5408\u300112 \uff5e 15 \u884c\u3092\u52a0\u3048\u3066\u3001matplotlib \u306e\u5b9f\u884c\u74b0\u5883\u3092\u8a2d\u5b9a\u3059\u308b\u3060\u3051\u3067\u3059\u3002<br>\u3000\u89aa\u548c\u6027\u9ad8\u3044\u3067\u3059\u306d\u3002<\/p>\n\n\n\n<p>\u2003\u3068\u3053\u308d\u3067\u3001\u6c34\u6587\u91cf\u306e\u983b\u5ea6\u5206\u6790\u3067\u306f\u8272\u3093\u306a\u5206\u5e03\u95a2\u6570\u3092\u60f3\u5b9a\u3057\u3066\u30fb\u30fb\u30fb\u3068\u3044\u3046\u306e\u304c\u696d\u754c\u306e\u30eb\u30fc\u30eb\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u304c\u3001\u6a19\u672c\u6570\u304c\u5927\u6570\u306b\u306a\u308b\u3068\u3001\u6975\u5024\u5206\u5e03\u306f Gumbel \u5206\u5e03\u3001F\u0155chet\u5206\u5e03\u3001\u8ca0\u306e Weibull \u5206\u5e03\u306e\u4f55\u308c\u304b\u306b\u53ce\u675f\u3059\u308b\uff08<a href=\"https:\/\/en-m-wikipedia-org.translate.goog\/wiki\/Fisher%E2%80%93Tippett%E2%80%93Gnedenko_theorem?_x_tr_sl=en&amp;_x_tr_tl=ja&amp;_x_tr_hl=ja&amp;_x_tr_pto=wapp\">Fisher-Tippett-Gnedenko theorem<\/a>\u3000<a href=\"https:\/\/qiita.com\/cotton-gluon\/items\/bd1a12e22cf4c2d8b805#%E5%85%B7%E4%BD%93%E4%BE%8B\" data-type=\"link\" data-id=\"https:\/\/qiita.com\/cotton-gluon\/items\/bd1a12e22cf4c2d8b805#%E5%85%B7%E4%BD%93%E4%BE%8B\">\u3053\u306e\u8a18\u4e8b<\/a>\u304c\u8208\u5473\u6df1\u3044\uff09\u3068\u3044\u3046\u306e\u304c\u6975\u5024\u7406\u8ad6\u306e\u6559\u3048\u308b\u3068\u3053\u308d\u3067\u3059\u3002<br>\u3000\u306a\u306e\u3067\u3001\u9650\u3089\u308c\u305f\u6a19\u672c\u6570\u3067\u5b9f\u7e3e\u5206\u5e03\u3068\u60f3\u5b9a\u3057\u305f\u5206\u5e03\u95a2\u6570\u306e\u9069\u5408\u5ea6\u3092\u76f8\u4e92\u306b\u6bd4\u8f03\u3059\u308b\u3053\u3068\u306b\u3055\u307b\u3069\u610f\u5473\u304c\u7121\u3044\u3088\u3046\u306b\u601d\u3044\u307e\u3059\uff08\u5408\u3063\u3066\u3044\u308b\u306b\u8d8a\u3057\u305f\u3053\u3068\u306f\u306a\u3044\u304c\u30fb\u30fb\u30fb\uff09\u3002\u4e0a\u306e 3 \u5206\u5e03\u3092\u7d44\u307f\u5408\u308f\u305b\u305f<a href=\"https:\/\/ja.wikipedia.org\/wiki\/%E6%A5%B5%E5%80%A4%E5%88%86%E5%B8%83\">\u4e00\u822c\u5316\u6975\u5024\u5206\u5e03\uff08GEV\uff09<\/a>\u4e00\u629e\u3067\u826f\u3044\u306e\u3067\u306f\u306a\u3044\u3067\u3057\u3087\u3046\u304b\uff1f<br>\u3000\u305d\u306e\u4ed6\u3001\u696d\u754c\u30eb\u30fc\u30eb\u306b\u95a2\u3057\u3066\u306f S\u25b2\u2605C \u306e\u4f7f\u7528\u3068\u304b\u3001\uff08\u6bcd\u6570\u3067\u306f\u306a\u304f\uff09\u30af\u30aa\u30f3\u30bf\u30a4\u30eb\u306e\u30ea\u30b5\u30f3\u30d7\u30ea\u30f3\u30b0\u3068\u304b\u3082\u9055\u548c\u611f\u304c\u3042\u308a\u307e\u3059\u3002\u4ed6\u5206\u91ce\u306e\u7d71\u8a08\u5206\u6790\u3067\u306f\u6c7a\u3057\u3066\u8033\u306b\u3057\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<p>\u3000\u4ee5\u4e0a\u3001matplotlib + latex \u306b\u4e8b\u5bc4\u305b\u3066\u3001\u73fe\u884c\u306e\u6c34\u6587\u7d71\u8a08\u306e\u6279\u8a55\u306b\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3057\u305f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u2003\u4eca\u56de\u306f\u4e0b\u56f3\u306e\u3088\u3046\u306b matplotlib \u3067 latex \u3092\u4f7f\u3046\u3068\u3044\u3046\u30f2\u30bf\u30af\u306a\u8a71\u984c\u3067\u3059\u3002 \u2003\u4e0a\u56f3\u306e\u63cf\u753b\u90e8\u306e\u30b3\u30fc\u30c9\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002 \u2003\u30b5\u30fc\u30c1\u30d1\u30b9\u4e0a\u306b latex.exe \u304c\u5b58\u5728\u3059\u308b\uff08can_use \u95a2\u6570\u306e\u623b\u308a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[43,37,44,19],"class_list":["post-453","post","type-post","status-publish","format-standard","hentry","category-it","tag-extream_value_statics","tag-latex","tag-matplotlib","tag-python"],"_links":{"self":[{"href":"https:\/\/www.flumen-jp.com\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/453","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.flumen-jp.com\/wordpress\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.flumen-jp.com\/wordpress\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.flumen-jp.com\/wordpress\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.flumen-jp.com\/wordpress\/index.php\/wp-json\/wp\/v2\/comments?post=453"}],"version-history":[{"count":6,"href":"https:\/\/www.flumen-jp.com\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/453\/revisions"}],"predecessor-version":[{"id":463,"href":"https:\/\/www.flumen-jp.com\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/453\/revisions\/463"}],"wp:attachment":[{"href":"https:\/\/www.flumen-jp.com\/wordpress\/index.php\/wp-json\/wp\/v2\/media?parent=453"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.flumen-jp.com\/wordpress\/index.php\/wp-json\/wp\/v2\/categories?post=453"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.flumen-jp.com\/wordpress\/index.php\/wp-json\/wp\/v2\/tags?post=453"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}