{"id":154,"date":"2019-11-15T16:23:42","date_gmt":"2019-11-15T07:23:42","guid":{"rendered":"http:\/\/aiacademy.jp\/media\/?p=154"},"modified":"2025-05-27T12:19:38","modified_gmt":"2025-05-27T03:19:38","slug":"%e3%80%90%e5%88%9d%e5%bf%83%e8%80%85%e5%90%91%e3%81%91%e3%80%91matplotlib%e5%85%a5%e9%96%80-python%e3%82%92%e4%bd%bf%e3%81%a3%e3%81%a6%e3%83%87%e3%83%bc%e3%82%bf%e3%82%92%e5%8f%af%e8%a6%96%e5%8c%96","status":"publish","type":"post","link":"https:\/\/aiacademy.jp\/media\/?p=154","title":{"rendered":"\u3010\u521d\u5fc3\u8005\u5411\u3051\u3011Matplotlib\u5165\u9580 | Python\u3092\u4f7f\u3063\u3066\u30c7\u30fc\u30bf\u3092\u53ef\u8996\u5316\u3057\u3066\u307f\u3088\u3046\uff01"},"content":{"rendered":"<div class=\"toc\">    <div id=\"toc_container\" class=\"sgb-toc--no-bullets js-smooth-scroll\" data-dialog-title=\"Table of Contents\">\n      <p class=\"toc_title\">\u76ee\u6b21 <\/p>\n      <ul class=\"toc_list\">  <li class=\"first\">    <a href=\"#i-0\">\u306f\u3058\u3081\u306b<\/a>  <\/li>  <li>    <a href=\"#i-1\">Matplotlib\u3068\u306f<\/a>  <\/li>  <li>    <a href=\"#i-2\">Matplotlib\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/a>  <\/li>  <li>    <a href=\"#i-3\">Matplotlib\u306e\u4f7f\u3044\u65b9<\/a>  <\/li>  <li>    <a href=\"#i-4\">\u6298\u308c\u7dda\u30b0\u30e9\u30d5<\/a>  <\/li>  <li>    <a href=\"#i-5\"><\/a>  <\/li>  <li>    <a href=\"#i-6\"><\/a>  <\/li>  <li>    <a href=\"#i-7\">\u3010\u7121\u6599\u52d5\u753b\uff1a\u500d\u901f\u3067\u5b66\u3076\uff01\u751f\u6210AI\u3092\u6d3b\u7528\u3057\u305f\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u52c9\u5f37\u6cd5\uff08\u77ed\u7e2e\u7248\uff09\u3011<\/a>  <\/li>  <li>    <a href=\"#i-8\">plot()<\/a>  <\/li>  <li>    <a href=\"#i-9\">\u68d2\u30b0\u30e9\u30d5<\/a>  <\/li>  <li>    <a href=\"#i-10\">\u00a0<\/a>  <\/li>  <li>    <a href=\"#i-11\">\u6563\u5e03\u56f3<\/a>  <\/li>  <li>    <a href=\"#i-12\">\u5186\u30b0\u30e9\u30d5<\/a>  <\/li>  <li>    <a href=\"#i-13\">\u30d2\u30b9\u30c8\u30b0\u30e9\u30e0<\/a>  <\/li>  <li>    <a href=\"#i-14\">\u7bb1\u3072\u3052\u56f3<\/a>  <\/li>  <li>    <a href=\"#i-15\">\u2728LINE\u53cb\u3060\u3061\u9650\u5b9a\uff1aAI\u4eba\u6750\u30b3\u30fc\u30b9 \u53d7\u8b1b\u304a\u7533\u8fbc\u307f\u53d7\u4ed8\u4e2d\uff01<\/a>  <\/li>  <li>    <a href=\"#i-16\">\u8907\u6570\u306e\u30b0\u30e9\u30d5\u3092\u63cf\u753b\u3059\u308b<\/a>  <\/li>  <li>    <a href=\"#i-17\">\u307e\u3068\u3081<\/a>  <\/li>  <li>    <a href=\"#i-18\">\u6f14\u7fd2\u554f\u984c<\/a>  <\/li>  <li>    <a href=\"#i-19\">Python\u3092\u52b9\u7387\u3088\u304f\u5b66\u3076\u306b\u306f\uff1f<\/a>  <\/li>  <li>    <a href=\"#i-20\">\u2728\u751f\u6210AI\u30b3\u30fc\u30b9 \u53d7\u8b1b\u304a\u7533\u8fbc\u307f\u53d7\u4ed8\u4e2d\uff01<\/a>  <\/li>  <li class=\"last\">    <a href=\"#i-21\">\u30aa\u30b9\u30b9\u30e1\u8a18\u4e8b<\/a>  <\/li><\/ul>\n      \n    <\/div><\/div><div class=\"toc\"><p><\/p>\n<\/div><h2 id=\"i-0\">\u306f\u3058\u3081\u306b<\/h2>\n<p>\u3053\u306e\u7ae0\u306e\u4e00\u90e8\u306b\u3001\u7d71\u8a08\u7528\u8a9e\u304c\u51fa\u3066\u6765\u307e\u3059\u304c\u3001\u7528\u8a9e\u306b\u95a2\u3057\u3066\u305d\u308c\u305e\u308c\u3057\u3063\u304b\u308a\u7406\u89e3\u3057\u305f\u3044\u65b9\u306f\u3001\u5408\u308f\u305b\u3066<a href=\"https:\/\/aiacademy.jp\/texts\/#statistics\" target=\"_blank\" rel=\"noopener\">\u7d71\u8a08\u5b66\u7de8 (\u7121\u6599\u767b\u9332\u3067\u8aad\u3081\u307e\u3059)<\/a>\u3082\u3054\u78ba\u8a8d\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><span class=\"keiko_blue keiko_green\">\u3053\u306e\u30b5\u30a4\u30c8\u306f\u3001Python\u3084\u751f\u6210AI\u306a\u3069\u3092\u5b66\u3079\u308b\u30aa\u30f3\u30e9\u30a4\u30f3\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30b9\u30af\u30fc\u30eb AI Academy Bootcamp\u304c\u904b\u55b6\u3057\u3066\u3044\u307e\u3059\u3002<\/span><\/p>\n<h2 id=\"i-1\">Matplotlib\u3068\u306f<\/h2>\n<p><strong>Matplotlib \u306fPython\u306e\u30b0\u30e9\u30d5\u63cf\u753b\u306e\u305f\u3081\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3059\u3002<\/strong><br>Matplotlib\u3092\u4f7f\u3046\u3053\u3068\u3067\u3001\u30b0\u30e9\u30d5\u306e\u63cf\u753b\u3084\u30c7\u30fc\u30bf\u306e\u53ef\u8996\u5316\u304c\u7c21\u5358\u306b\u884c\u3048\u307e\u3059\u3002<br>\u6298\u308c\u7dda\u30b0\u30e9\u30d5\u3001\u30d2\u30b9\u30c8\u30b0\u30e9\u30e0\u3084\u6563\u5e03\u56f3\u306a\u3069\u8868\u73fe\u53ef\u80fd\u3067\u3059\u3002<br><a href=\"https:\/\/matplotlib.org\/gallery.html\" target=\"_blank\" rel=\"noopener nofollow\">\u516c\u5f0f\u30ae\u30e3\u30e9\u30ea\u30fc<\/a>\u306b\u3066\u5b9f\u969b\u306e\u4f8b\u3092\u898b\u308b\u3053\u3068\u3067\u3088\u308a\u7406\u89e3\u304c\u6df1\u307e\u308a\u307e\u3059\u306e\u3067\u53c2\u8003\u306b\u3057\u3066\u9802\u3051\u308c\u3070\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<h2 id=\"i-2\">Matplotlib\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n<p>pip\u30b3\u30de\u30f3\u30c9\u3092\u7528\u3044\u305f<strong>Matplotlib<\/strong>\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306f\u4e0b\u8a18\u306e\u30b3\u30de\u30f3\u30c9\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u51fa\u6765\u307e\u3059\u3002<br>Mac\u306e\u65b9\u306f\u30bf\u30fc\u30df\u30ca\u30eb\u3001Windows\u306e\u65b9\u306f\u30b3\u30de\u30f3\u30c9\u30d7\u30ed\u30f3\u30d7\u30c8\u4e0a\u3067\u5b9f\u884c\u3059\u308b\u3053\u3068\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u51fa\u6765\u307e\u3059\u3002<\/p>\n<pre><code class=\"shell\">pip install matplotlib\n<\/code><\/pre>\n<p>Jupyter Notebook\u3092\u304a\u4f7f\u3044\u306e\u65b9\u306f\u3001\u8d77\u52d5\u3057\u305fNotebook\u306e\u30bb\u30eb\u306b\u3001\u5148\u982d\u306b!\u30de\u30fc\u30af\u3092\u3064\u3051\u3066\u5b9f\u884c\u3059\u308b\u3053\u3068\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u3002<\/p>\n<pre><code class=\"shell\">!pip install matplotlib<\/code><\/pre>\n<h2 id=\"i-3\">Matplotlib\u306e\u4f7f\u3044\u65b9<\/h2>\n<p>Matplotlib\u3092\u4f7f\u3063\u305f\u6700\u3082\u7c21\u5358\u306a\u30b0\u30e9\u30d5\u306e\u66f8\u304d\u65b9\u306f\u6b21\u306e\u901a\u308a\u3067\u3059\u3002<br>1. matplotlib.pyplot\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3059\u308b<br>2. x\u8ef8\u306e\u914d\u5217\u3092\u4f5c\u308b<br>3. y\u8ef8\u306e\u914d\u5217\u3092\u4f5c\u308b<br>4. plot\u95a2\u6570\u3092\u4f7f\u3044\u30d7\u30ed\u30c3\u30c8\u3059\u308b<br>5. show\u95a2\u6570\u3092\u4f7f\u3044\u30d7\u30ed\u30c3\u30c8\u3057\u305f\u30b0\u30e9\u30d5\u3092\u63cf\u753b\u3059\u308b<\/p>\n<pre><code>import numpy as np\nimport matplotlib.pyplot as plt\n\nx = np.arange(-5, 5, 0.1) #-5\u304b\u30895\u307e\u30670.1\u533a\u5207\u308a\u3067\u914d\u5217\u3092\u4f5c\u308b\ny = np.sin(x) #\u914d\u5217x\u306e\u5024\u306b\u95a2\u3057\u3066\u305d\u308c\u305e\u308csin(x)\u3092\u6c42\u3081\u3066y\u8ef8\u306e\u914d\u5217\u3092\u751f\u6210\n\nplt.plot(x,y) # \u3053\u306e\u5834\u5408\u306eplot\u95a2\u6570\u306e\u7b2c\u4e00\u5f15\u6570x\u306f\u3001x\u8ef8\u306b\u5bfe\u5fdc\u3057\u3001\u7b2c\u4e8c\u5f15\u6570\u306ey\u304cy\u8ef8\u306b\u3042\u305f\u308a\u307e\u3059\u3002\nplt.show()\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/aiacademy.jp\/assets\/images\/plot_1.png\" alt=\"plot\"><\/p>\n<h2 id=\"i-4\">\u6298\u308c\u7dda\u30b0\u30e9\u30d5<\/h2>\n<p><strong>\u6298\u308c\u7dda\u30b0\u30e9\u30d5\u306f\u3001\u6570\u91cf\u306e\u5927\u304d\u3055\u3092\u8868\u3059\u4f4d\u7f6e\u3092\u7dda\u3067\u7d50\u3093\u3060\u30b0\u30e9\u30d5\u3067\u3059\u3002<\/strong><br>\u6642\u9593\u3068\u3068\u3082\u306b\u5909\u5316\u3059\u308b\u6570\u91cf\u3092\u793a\u3059\u3068\u304d\u306b\u5229\u7528\u3057\u307e\u3059\u3002<\/p>\n<pre><code>import matplotlib.pyplot as plt\ndata = [2, 4, 6, 3, 5, 8, 4, 5]\nplt.plot(data)\nplt.show()\n\n# r--\u306f\u8d64\u306e\u70b9\u7dda b--\u306f\u9752\u306e\u70b9\u7dda g-- \u306f\u7dd1\u306e\u70b9\u7dda\nplt.plot([1,2,3,4],[1,5,10,15],\"r--\") # \u5f15\u6570\u306b\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u6e21\u3055\u305a\u306b \u8272 \u306b -- \u3092\u3064\u3051\u308b\u3068\u8272 + \u70b9\u7dda\u3067\u8868\u73fe\u3067\u304d\u307e\u3059\nplt.show()\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"\/assets\/images\/matplotlib_plot.png\" alt=\"\"><\/p>\n<h2 id=\"i-5\">\n\n\n<\/h2>\n<p>\n\n\n<\/p><h2 id=\"i-6\"><!-- \/wp:paragraph --><\/h2>\n<p><!-- wp:heading --><\/p>\n<h2 class=\"wp-block-heading\" id=\"i-7\">\u3010\u7121\u6599\u52d5\u753b\uff1a<strong>\u500d\u901f\u3067\u5b66\u3076\uff01\u751f\u6210AI\u3092\u6d3b\u7528\u3057\u305f\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u52c9\u5f37\u6cd5\uff08\u77ed\u7e2e\u7248\uff09\u3011<\/strong><\/h2>\n<p><!-- \/wp:heading --> <!-- wp:paragraph --><\/p>\n<p>\u751f\u6210AI\u3092\u6d3b\u7528\u3057\u3066\u52b9\u7387\u7684\u306b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3092\u5b66\u3076\u65b9\u6cd5\u3092\u89e3\u8aac\u3057\u3066\u3044\u307e\u3059\u3002\u751f\u6210AI\u306e\u57fa\u672c\u7684\u306a\u4ed5\u7d44\u307f\u3084\u52b9\u679c\u7684\u306a\u6d3b\u7528\u6cd5\u3001\u6ce8\u610f\u70b9\u306b\u3064\u3044\u3066\u3082\u8a73\u3057\u304f\u8aac\u660e\u3002\u52c9\u5f37\u6cd5\u3068\u3068\u3082\u306b\u751f\u6210AI\u305d\u306e\u3082\u306e\u306b\u3064\u3044\u3066\u3082\u5b66\u3079\u308b\u5185\u5bb9\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002\u305c\u3072\u3054\u89a7\u304f\u3060\u3055\u3044\uff01\u3000<\/p>\n<p><iframe loading=\"lazy\" src=\"https:\/\/player.vimeo.com\/video\/1069835048?h=e43b17d6de&amp;dnt=1&amp;app_id=122963\" width=\"880\" height=\"495\" frameborder=\"0\" allow=\"autoplay; fullscreen; picture-in-picture; clipboard-write; encrypted-media\"><\/iframe><\/p>\n<p><!-- \/wp:paragraph --><\/p>\n<p><!-- wp:embed {\"url\":\"https:\/\/vimeo.com\/1069835048\/e43b17d6de?share=copy\",\"type\":\"video\",\"providerNameSlug\":\"vimeo\"} --><\/p>\n<figure class=\"wp-block-embed is-type-video is-provider-vimeo wp-block-embed-vimeo\">\n<div class=\"wp-block-embed__wrapper\"><strong style=\"font-size: revert; color: initial;\">\u5168\u7de8\u306f\u3001AI Academy\u516c\u5f0fLINE\u3067\u914d\u4fe1\u4e2d\u3067\u3059\u3002<a href=\"https:\/\/lin.ee\/3E4GzWk\" rel=\"nofollow noopener\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" width=\"910\" height=\"517\" class=\"wp-image-6799\" style=\"width: 158px; height: auto;\" src=\"https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2019\/11\/LINE_Buttom.png\" alt=\"\" srcset=\"https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2019\/11\/LINE_Buttom.png 910w, https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2019\/11\/LINE_Buttom-300x170.png 300w, https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2019\/11\/LINE_Buttom-768x436.png 768w\" sizes=\"auto, (max-width: 910px) 100vw, 910px\"><\/a><\/strong><\/div>\n<\/figure>\n<p><!-- \/wp:image --><\/p>\n<p><!-- wp:video \/--><\/p>\n<p><!-- \/wp:image --><\/p>\n<p><!-- \/wp:image --><\/p>\n<p><!-- wp:html --><\/p>\n<p><!-- \/wp:html --><\/p>\n<p><!-- wp:paragraph --><\/p>\n<p><!-- \/wp:paragraph --><\/p>\n<p><!-- wp:paragraph --><\/p>\n<p><!-- \/wp:paragraph --><\/p>\n<p><!-- wp:html --><\/p>\n<p><!-- \/wp:html --><\/p>\n<h2 id=\"i-8\">plot()<\/h2>\n<p>\u7b2c\u4e00\u5f15\u6570\u3067x\u8ef8\u3001\u7b2c\u4e8c\u5f15\u6570\u3067y\u8ef8\u306e\u5024\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<br>\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u5404\u70b9\u304c\u7dda\u3067\u7e4b\u304c\u3063\u3066\u3044\u307e\u3059\u304c\u3001\u7b2c\u4e09\u5f15\u6570\u306e\u5024\u3092\u5909\u66f4\u3059\u308b\u3053\u3068\u3067\u3044\u308d\u3044\u308d\u306a\u30b9\u30bf\u30a4\u30eb\u306e\u30b0\u30e9\u30d5\u306b\u3067\u304d\u307e\u3059\u3002<br>\u307e\u305f\u3001\u5f15\u6570\u306f\uff13\u500b\u3067\uff11\u30bb\u30c3\u30c8\u3068\u306a\u3063\u3066\u304a\u308a\u3001\u5f15\u6570\u3092\u7d9a\u3051\u3066\u4f55\u500b\u3082\u30d7\u30ed\u30c3\u30c8\u3057\u305f\u3044\u30c7\u30fc\u30bf\u3092\u5165\u308c\u308b\u3053\u3068\u3067\u540c\u3058\u30b0\u30e9\u30d5\u5185\u306b\u3044\u304f\u3064\u3082\u7570\u306a\u308b\u30b9\u30bf\u30a4\u30eb\u3067\u30d7\u30ed\u30c3\u30c8\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<br>\u4f8b\uff09<br>\u201co\u201d \u2013 \u70b9<br>\u201c^\u201d \u2013 \u4e09\u89d2\u306e\u70b9<br>\u201cs\u201d \u2013 \u56db\u89d2\u306e\u70b9<br>plot()\u3068scatter()\u3067\u5229\u7528\u53ef\u80fd\u306a<a href=\"https:\/\/matplotlib.org\/api\/markers_api.html\" target=\"_blank\" rel=\"noopener nofollow\">marker<\/a>\u306b\u95a2\u3057\u3066\u306e\u516c\u5f0f\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u3067\u3059\u3002<br>\u3055\u3089\u306b\u30aa\u30d7\u30b7\u30e7\u30f3\u306b\u306f<strong>color<\/strong>\u3082\u6307\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br>\u4f8b\uff09<br>\u201cred\u201d \u3082\u3057\u304f\u306f \u201cr\u201d \u2013 \u8d64<br>\u201cgreen\u201d \u3082\u3057\u304f\u306f \u201cg\u201d \u2013 \u7dd1<br>\u201cblue\u201d \u3082\u3057\u304f\u306f \u201cb\u201d \u2013 \u9752<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/matplotlib.org\/users\/colors-2.png\" alt=\"\"><\/p>\n<p><a href=\"https:\/\/matplotlib.org\/users\/colors.html\" target=\"_blank\" rel=\"noopener nofollow\">\u516c\u5f0f\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u5f15\u7528<\/a><\/p>\n<pre><code>import matplotlib.pyplot as plt\ndata = [20, 40, 60, 80 ]\ny_data = [10, 5, 3, 1]\nplt.plot(data, y_data, marker=\"o\")\nplt.savefig(\"graph.png\")\nplt.show()\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/camo.qiitausercontent.com\/072b957010a2a0c0547a9f5758e6da2aa5b14b2d\/68747470733a2f2f71696974612d696d6167652d73746f72652e73332e616d617a6f6e6177732e636f6d2f302f3137313731352f35623665376136322d363166382d343133372d303939662d3537326162386537306438362e706e67\" alt=\"\"><\/p>\n<p>\u307e\u305f\u3001plt.xlabel(\u201cx\u201d)\u3067x\u8ef8\u306e\u30e9\u30d9\u30eb\u3092\u4ed8\u3051\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002<br>\u540c\u69d8\u306b\u3001plt.ylabel(\u201cy\u201d)\u3067y\u8ef8\u306e\u30e9\u30d9\u30eb\u3092\u4ed8\u3051\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u3002<br>\u3055\u3089\u306b\u3001plt.savefig()\u3067\u63cf\u753b\u3057\u305f\u30b0\u30e9\u30d5\u3092\u753b\u50cf\u3068\u3057\u3066\u4fdd\u5b58\u3059\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u3002<br>\u8907\u6570\u306e\u30b0\u30e9\u30d5\u3092\u63cf\u753b\u3055\u305b\u305f\u3044\u5834\u5408\u306f\u3001plot()\u306e\u5f8c\u306b\u5225\u306e\u30b0\u30e9\u30d5\u306eplot()\u3092\u884c\u3044\u3001show()\u3092\u5b9f\u884c\u3059\u308c\u3070\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<p><!-- \/wp:paragraph --><\/p>\n<p><!-- wp:image {\"lightbox\":{\"enabled\":false},\"id\":6652,\"sizeSlug\":\"large\",\"linkDestination\":\"custom\"} --><\/p>\n<p>&nbsp;<\/p>\n<p><!-- \/wp:image --><\/p>\n<h2 id=\"i-9\">\u68d2\u30b0\u30e9\u30d5<\/h2>\n<p><strong>\u68d2\u30b0\u30e9\u30d5\u306f\u3001\u8907\u6570\u306e\u72ec\u7acb\u3057\u305f\u9805\u76ee\u540c\u58eb\u306e\u30c7\u30fc\u30bf\u3092\u6bd4\u8f03\u3059\u308b\u6642\u306b\u5229\u7528\u3059\u308b\u30b0\u30e9\u30d5\u3067\u3059\u3002<\/strong><br>pyplot\u30e2\u30b8\u30e5\u30fc\u30eb\u306e<strong><a href=\"https:\/\/matplotlib.org\/api\/_as_gen\/matplotlib.pyplot.bar.html\" target=\"_blank\" rel=\"noopener nofollow\">bar()<\/a><\/strong>\u3067\u4f5c\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u3002<\/p>\n<pre><code class=\"python:\">import matplotlib.pyplot as plt\na = range(0, 7)\nb = [55,21,61,98,85,52,99]\nplt.bar(a, b)\n# plt.barh(a, b) # \u6a2a\u68d2\u306e\u68d2\u30b0\u30e9\u30d5\nplt.show()\n\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n# \u68d2\u30b0\u30e9\u30d5\nm = (\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\",\"8\",\"9\",\"10\",\"11\",\"12\")\ny_pos = np.arange(len(m))\n# \u4e0b\u8a18sales\u5909\u6570\u5185\u306e\u6570\u5024\u3092\u5909\u66f4\u3057\u3066\u3001\u8272\u3005\u5b9f\u884c\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002\nsales = [10 ,18 ,32,54,65,96, 120, 140, 145,162, 188, 202]\n\nplt.bar(y_pos, sales, alpha=0.5)\nplt.ylabel(\"Usage\")\nplt.title(\"Sales Trends\") # \u58f2\u4e0a\u63a8\u79fb\nplt.show()\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"\/assets\/images\/matplotlib_bar.png\" alt=\"\"><\/p>\n<p>\u3061\u306a\u307f\u306b\u6a2a\u68d2\u306e\u30b0\u30e9\u30d5\u306f<strong><a href=\"https:\/\/matplotlib.org\/api\/_as_gen\/matplotlib.pyplot.barh.html\" target=\"_blank\" rel=\"noopener nofollow\">plt.barh()<\/a><\/strong>\u3067\u4f5c\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u3002<\/p>\n<pre><code>import matplotlib.pyplot as plt<br>\na = range(0, 7)<br>\nb = [55,21,61,98,85,52,99]<br>\nplt.barh(a, b)<br>\n# plt.barh(a, b) # \u6a2a\u68d2\u306e\u68d2\u30b0\u30e9\u30d5<br>\nplt.show()<\/code><\/pre>\n<pre><code><\/code><\/pre>\n<p><!-- wp:heading --><\/p>\n<h2 class=\"wp-block-heading\" id=\"i-10\">&nbsp;<\/h2>\n<p><!-- \/wp:heading --><\/p>\n<p><!-- wp:image {\"id\":3739,\"sizeSlug\":\"full\",\"linkDestination\":\"none\"} --><\/p>\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"362\" height=\"248\" class=\"wp-image-3739\" src=\"https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2023\/02\/download.png\" alt=\"\" srcset=\"https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2023\/02\/download.png 362w, https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2023\/02\/download-300x206.png 300w\" sizes=\"auto, (max-width: 362px) 100vw, 362px\"><\/figure>\n<p><!-- \/wp:image --><\/p>\n<h2 id=\"i-11\">\u6563\u5e03\u56f3<\/h2>\n<p><strong>\u6563\u5e03\u56f3\u306f\u3001\u6a2a\u8ef8\u3068\u7e26\u8ef8\u306b\u305d\u308c\u305e\u308c\u5225\u306e\u91cf\u3092\u3068\u308a\u3001\u30c7\u30fc\u30bf\u3092\u30d7\u30ed\u30c3\u30c8\u3057\u305f\u30b0\u30e9\u30d5\u3067\u3059\u3002<\/strong><br>2\u3064\u306e\u91cf\u306b\u95a2\u4fc2\u304c\u3042\u308b\u304b\u3092\u898b\u308b\u6642\u306b\u5229\u7528\u3059\u308b\u30b0\u30e9\u30d5\u3067\u3059\u3002<br>pyplot\u30e2\u30b8\u30e5\u30fc\u30eb\u306e<strong><a href=\"https:\/\/matplotlib.org\/api\/_as_gen\/matplotlib.pyplot.scatter.html\" target=\"_blank\" rel=\"noopener nofollow\">scatter()<\/a><\/strong>\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u6563\u5e03\u56f3\u3092\u63cf\u753b\u51fa\u6765\u307e\u3059\u3002<\/p>\n<pre><code>import matplotlib.pyplot as plt\nx = [10, 51, 44, 23, 55, 95]\ny = [5, 125, 2, 55, 19, 55]\nplt.scatter(x,y)\nplt.show()\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"\/assets\/images_test\/22_16dfc452ae3.png\" alt=\"\"><\/p>\n<p>scatter\u306e\u7b2c3\u5f15\u6570\u306b\u30de\u30fc\u30ab\u30fc\u306e\u5f62\u72b6(o\u3084+)\u3092\u8a2d\u5b9a\u3067\u304d\u307e\u3059\u3002<br>\u307e\u305f\u3001\u8272\u3092\u5909\u66f4\u3059\u308b\u306b\u306f<a href=\"https:\/\/matplotlib.org\/api\/_as_gen\/matplotlib.pyplot.pie.html\" target=\"_blank\" rel=\"noopener nofollow\">plot()<\/a>\u306e\u6240\u3067\u3082\u8aac\u660e\u3057\u307e\u3057\u305f\u304c\u3001\u7b2c3\u5f15\u6570\u306bcolor=\u201dblue\u201d\u306e\u3088\u3046\u306b\u3059\u308b\u3053\u3068\u3067\u8272\u5909\u63db\u3082\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<p><!-- wp:image {\"lightbox\":{\"enabled\":false},\"id\":5719,\"width\":\"659px\",\"height\":\"auto\",\"sizeSlug\":\"large\",\"linkDestination\":\"custom\"} --><\/p>\n<p><!-- \/wp:image --><\/p>\n<h2 id=\"i-12\">\u5186\u30b0\u30e9\u30d5<\/h2>\n<p><strong>\u5186\u30b0\u30e9\u30d5\u3068\u306f\u3001\u4e38\u3044\u56f3\u5f62\u306e\u30b0\u30e9\u30d5\u3067\u3001\u4f55\u3089\u304b\u306e\u69cb\u6210\u6bd4\u7387\u304c\u6247\u5f62\u306b\u5206\u5272\u3055\u308c\u8868\u3055\u308c\u305f\u30b0\u30e9\u30d5\u3067\u3059\u3002<\/strong><br>pyplot\u30e2\u30b8\u30e5\u30fc\u30eb\u306e<strong><a href=\"https:\/\/matplotlib.org\/api\/_as_gen\/matplotlib.pyplot.pie.html\" target=\"_blank\" rel=\"noopener nofollow\">plt.pie()<\/a><\/strong>\u3067\u5186\u30b0\u30e9\u30d5\u3092\u63cf\u753b\u51fa\u6765\u307e\u3059\u3002<br>\u5186\u30b0\u30e9\u30d5\u3067\u306f\u5168\u4f53\u306e\u4e2d\u3067\u306e\u69cb\u6210\u6bd4\u3092\u307f\u308b\u3068\u304d\u306b\u5229\u7528\u3057\u307e\u3059\u3002<\/p>\n<pre><code class=\"python:\">import matplotlib.pyplot as plt\nlabels = [\"A\", \"B\", \"C\", \"D\", \"E\"]\ndata = [54, 32, 18, 44, 29]\nex = [0.1, 0, 0, 0, 0]\n# autopct=\"%1.1f%%\"\u306f\u5c0f\u6570\u70b9\u306e\u8868\u793a\u6841\u6570\u306b\u306a\u308a\u307e\u3059\u30021.1\u3068\u3059\u308b\u30681\u3064\u30021.2\u3068\u3059\u308b\u3068\uff12\u3064\u306b\u306a\u308a\u307e\u3059\u3002\n# explode\u30aa\u30d7\u30b7\u30e7\u30f3\u30671\u3064\u3081\u306e\u8981\u7d20\u309210%\u305a\u3089\u3057\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u5c11\u3057\u76ee\u7acb\u305f\u305b\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002\n#counterclock\u30aa\u30d7\u30b7\u30e7\u30f3\u3067False\u306b\u3059\u308b\u3068\u30ea\u30b9\u30c8\u306e\u5b9a\u7fa9\u3057\u305f\u9806\u306b\u8868\u793a\u306b\u306a\u308a\u307e\u3059\u3002\n# \u3053\u308c\u304cTrue\u306b\u306a\u308b\u3068\u53cd\u6642\u8a08\u5468\u308a\u306b\u5186\u30b0\u30e9\u30d5\u306e\u8981\u7d20\u304c\u69cb\u6210\u3055\u308c\u307e\u3059\u3002\nplt.pie(data, explode=ex, labels=labels, autopct=\"%1.1f%%\", counterclock=False)\nplt.show()\n\nlabels = [\"Python\", \"Ruby\", \"Java\", \"C++\", \"PHP\"]\nsizes  = [40, 12, 24, 16, 9]\ncolors =[\"navy\", \"yellow\", \"blue\", \"gold\", \"tomato\"]\nplt.pie(sizes, labels=labels, colors=colors)\nplt.axis(\"equal\") # \u3053\u306e\u884c\u3092\u8ffd\u52a0\u3059\u308b\u3068\u7dba\u9e97\u306a\u5186\u30b0\u30e9\u30d5\u304c\u63cf\u3051\u307e\u3059\u3002\nplt.show()\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"\/assets\/images\/matplotlib_pie.png\" alt=\"\"><\/p>\n<h2 id=\"i-13\">\u30d2\u30b9\u30c8\u30b0\u30e9\u30e0<\/h2>\n<p><strong>\u30d2\u30b9\u30c8\u30b0\u30e9\u30e0\u306f\u3001\u3042\u308b\u9805\u76ee\u306e\u6563\u3089\u3070\u308a\u5177\u5408(\u5ea6\u6570\u5206\u5e03)\u3092\u8868\u3059\u6642\u306b\u5229\u7528\u3059\u308b\u30b0\u30e9\u30d5\u3067\u3059\u3002<\/strong><br>\u30d2\u30b9\u30c8\u30b0\u30e9\u30e0\u3068\u68d2\u30b0\u30e9\u30d5\u306f\u4f3c\u3066\u3044\u308b\u3068\u3053\u308d\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u30d2\u30b9\u30c8\u30b0\u30e9\u30e0\u306b\u306f\u68d2\u3068\u68d2\u306e\u9593\u306b\u9593\u9694\u304c\u306a\u3044\u3068\u3044\u3046\u70b9\u3068x\u8ef8\u306f\u30c7\u30fc\u30bf\u306e\u533a\u9593\u3067\u533a\u5207\u3089\u308c\u3066\u304a\u308a\u3001\u9023\u7d9a\u3057\u305f\u30c7\u30fc\u30bf\u3092\u793a\u3057\u3066\u3044\u308b\u305f\u3081\u3001\u5358\u7d14\u306b\u8907\u6570\u306e\u9805\u76ee\u3092\u6bd4\u8f03\u3059\u308b\u68d2\u30b0\u30e9\u30d5\u3068\u69cb\u6210\u304c\u9055\u3044\u307e\u3059\u3002<br><strong><a href=\"https:\/\/matplotlib.org\/api\/_as_gen\/matplotlib.pyplot.hist.html\" target=\"_blank\" rel=\"noopener nofollow\">hist()<\/a><\/strong>\u3092\u4f7f\u3046\u3053\u3068\u3067\u30d2\u30b9\u30c8\u30b0\u30e9\u30e0\u3092\u63cf\u753b\u3067\u304d\u307e\u3059\u3002<br>\u30aa\u30d7\u30b7\u30e7\u30f3\u306b\u306f\u3001bins\u3084color\u306a\u3069\u304c\u3042\u308a\u3001\u68d2\u306e\u6570\u3092\u6307\u5b9a\u3057\u305f\u308a\u3001\u68d2\u306e\u8272\u3092\u5909\u3048\u305f\u308a\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre><code class=\"python:\">import matplotlib.pyplot as plt\nimport numpy as np\n\n# \u5e73\u574710\u3001\u6a19\u6e96\u504f\u5dee10 \u306e\u6b63\u898f\u4e71\u6570\u3092100\u4ef6\u751f\u6210\nx = np.random.normal(10, 10, 1000)\n\nplt.hist(x)\n# \u30d2\u30b9\u30c8\u30b0\u30e9\u30e0\u3092\u8868\u793a\nplt.show()\n# \u5f15\u6570\u306bbins=\u6570\u5b57\u3067\u30d2\u30b9\u30c8\u30b0\u30e9\u30e0\u306e\u68d2\u306e\u6570\u3092\u6307\u5b9a\u3067\u304d\u307e\u3059\u3002\n# plt.hist(x, bins=16)\n# orientation=\"horizontal\"\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3067\u6a2a\u68d2\u3068\u3057\u3066\u63cf\u753b\u3082\u53ef\u80fd\u3067\u3059\u3002\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"\/assets\/images\/hist.png\" alt=\"\"><\/p>\n<h2 id=\"i-14\">\u7bb1\u3072\u3052\u56f3<\/h2>\n<p><strong>\u7bb1\u3072\u3052\u56f3 (box plot) \u306f\u3001\u30c7\u30fc\u30bf\u306e\u5206\u5e03\u3084\u5024\u306e\u3070\u3089\u3064\u304d\u3092\u308f\u304b\u308a\u3084\u3059\u304f\u8868\u73fe\u3059\u308b\u305f\u3081\u306e\u30b0\u30e9\u30d5\u3067\u3059\u3002<\/strong><br>\u7bb1\u3072\u3052\u56f3\u306f\u3001\u6700\u5927\u5024\u3001\u6700\u5c0f\u5024\u306b\u52a0\u3048\u3001\u7b2c\u4e00\u56db\u5206\u4f4d\u6570\u3001\u7b2c\u4e8c\u56db\u5206\u4f4d\u6570\u3001\u7b2c\u4e09\u56db\u5206\u4f4d\u6570\u3068\u547c\u3070\u308c\u308b\u56db\u5206\u4f4d\u6570\u306e\u60c5\u5831\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002<br>\u63cf\u753b\u3059\u308b\u306b\u306f\u3001<em>plt.boxplot()<\/em>\u3092\u5229\u7528\u3057\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" src=\"\/assets\/images_test\/22_16a1097c819.png\" alt=\"\"><\/p>\n<pre><code class=\"python:\">%matplotlib inline # Jupyter Notebook\u3092\u5229\u7528\u3057\u3066\u3044\u308b\u65b9\u306e\u307f\u8a18\u8ff0\u3057\u3066\u304f\u3060\u3055\u3044\u3002\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n# \u3042\u308b10\u4eba\u306e\u751f\u5f92\u306e\u8eab\u9577\nmath = [162, 168, 172, 181, 176, 168, 173, 175, 162, 169]\nx = np.array(math)\nplt.title('height')\nplt.grid() # \u6a2a\u7dda\u30e9\u30a4\u30f3\u3092\u5165\u308c\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\n\nplt.boxplot(x)\nplt.show()\n\n\"\"\"\n# \u4e0b\u8a18\u30b3\u30fc\u30c9\u3067\u3082\u540c\u69d8\u306b\u63cf\u753b\u53ef\u80fd\u3067\u3059\u3002\n\nimport matplotlib.pyplot as plt\n# \u3042\u308b10\u4eba\u306e\u751f\u5f92\u306e\u8eab\u9577\nmath = [162, 168, 172, 181, 176, 168, 173, 175, 162, 169]\n# \u7bb1\u3072\u3052\u56f3\nfig, ax = plt.subplots()\nbp = ax.boxplot(math)\nplt.title('height')\nplt.grid() # \u6a2a\u7dda\u30e9\u30a4\u30f3\u3092\u5165\u308c\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\n# \u63cf\u753b\nplt.show()\n\"\"\"\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"\/assets\/images_test\/22_16a10993f10.png\" alt=\"\"><\/p>\n<p>\u8907\u6570\u63cf\u753b\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002 \u305d\u306e\u969b\u306f\u3001boxplot()\u306e\u5f15\u6570\u306b\u30bf\u30d7\u30eb\u3092\u5229\u7528\u3057\u307e\u3059\u3002<\/p>\n<pre><code class=\"python:\">%matplotlib inline # Jupyter Notebook\u3092\u5229\u7528\u3057\u3066\u3044\u308b\u65b9\u306e\u307f\u8a18\u8ff0\u3057\u3066\u304f\u3060\u3055\u3044\u3002\nimport matplotlib.pyplot as plt\n\n# \u6570\u5b66\u306e\u70b9\u6570\nmath = [82, 75, 50, 73, 65, 95, 78, 93, 71, 83]\n# \u82f1\u8a9e\u306e\u70b9\u6570\nenglish = [77, 92, 62, 77, 64, 45, 28, 60, 37, 86]\n\n# \u70b9\u6570\u306e\u30bf\u30d7\u30eb\npoints = (math, english)\n\n# \u7bb1\u3072\u3052\u56f3\nfig, ax = plt.subplots()\n\n\nbp = ax.boxplot(points) # \u8907\u6570\u6307\u5b9a\u3059\u308b\u5834\u5408\u306f\u30bf\u30d7\u30eb\u578b\u3067\u6e21\u3057\u307e\u3059\u3002\nax.set_xticklabels(['math', 'english'])\n\nplt.title('exam')\nplt.grid() # \u6a2a\u7dda\u30e9\u30a4\u30f3\u3092\u5165\u308c\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\n\n# \u63cf\u753b\nplt.show()\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"\/assets\/images_test\/22_16a109a1341.png\" alt=\"\"><\/p>\n<h2 id=\"i-15\">\u2728LINE\u53cb\u3060\u3061\u9650\u5b9a\uff1aAI\u4eba\u6750\u30b3\u30fc\u30b9 \u53d7\u8b1b\u304a\u7533\u8fbc\u307f\u53d7\u4ed8\u4e2d\uff01<\/h2>\n<figure class=\"wp-block-video\"><\/figure>\n<p><strong> <span class=\"sgb-label-main-c\">AI Academy Bootcamp LINE\u516c\u5f0f<\/span><\/strong> \u304b\u3089\u306e\u307f\u3001\u304a\u7533\u8fbc\u3067\u304d\u308b\u3001\u300cAI\u4eba\u6750\u30b3\u30fc\u30b9 \u52d5\u753b\u30d7\u30e9\u30f3\u300d\u3067\u3059\uff01AI\u30ea\u30c6\u30e9\u30b7\u30fc\u304b\u3089Python\u3001\u30c7\u30fc\u30bf\u5206\u6790\u3001Web\u958b\u767a\u307e\u3067\u5b66\u3079\u307e\u3059\u3002\u304a\u5f97\u306a\u5272\u5f15\u30af\u30fc\u30dd\u30f3\u3082\u30d7\u30ec\u30bc\u30f3\u30c8\u3057\u3066\u3044\u307e\u3059\uff01<\/p>\n<p><strong>\u5358\u72ec\u3067\u5b66\u3076\u3088\u308a\u3001\u5168\u30b3\u30fc\u30b9\u3092\u4e00\u6c17\u306b\u5b66\u3076\u3053\u3068\u3067\u5f97\u3089\u308c\u308b\u300c\u5b66\u7fd2\u30b7\u30ca\u30b8\u30fc\u52b9\u679c\u300d\u304c\u7279\u9577\u3002<\/strong><br>\u57fa\u790e\u304b\u3089\u5fdc\u7528\u307e\u3067\u3001\u30c7\u30fc\u30bf\u5206\u6790\u3068AI\u958b\u767a\u306e\u30b9\u30ad\u30eb\u3092\u52b9\u7387\u3088\u304f\u8eab\u306b\u3064\u3051\u3089\u308c\u307e\u3059\u3002<\/p>\n<p><!-- wp:image {\"lightbox\":{\"enabled\":false},\"id\":6796,\"sizeSlug\":\"large\",\"linkDestination\":\"custom\"} --><\/p>\n<p><!-- wp:image {\"lightbox\":{\"enabled\":false},\"id\":7069,\"sizeSlug\":\"large\",\"linkDestination\":\"custom\"} --><\/p>\n<p><!-- wp:image {\"lightbox\":{\"enabled\":false},\"id\":7228,\"sizeSlug\":\"large\",\"linkDestination\":\"custom\"} --><\/p>\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/lin.ee\/3E4GzWk\" target=\"_blank\" rel=\"noreferrer noopener nofollow\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"349\" class=\"wp-image-7228\" src=\"https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2019\/11\/\u30af\u30fc\u30dd\u30f3Media06-1024x349.png\" alt=\"\" srcset=\"https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2019\/11\/\u30af\u30fc\u30dd\u30f3Media06-1024x349.png 1024w, https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2019\/11\/\u30af\u30fc\u30dd\u30f3Media06-300x102.png 300w, https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2019\/11\/\u30af\u30fc\u30dd\u30f3Media06-768x261.png 768w, https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2019\/11\/\u30af\u30fc\u30dd\u30f3Media06-1536x523.png 1536w, https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2019\/11\/\u30af\u30fc\u30dd\u30f3Media06-2048x697.png 2048w, https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2019\/11\/\u30af\u30fc\u30dd\u30f3Media06-940x320.png 940w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\"><\/a><\/figure>\n<p><!-- \/wp:image --><\/p>\n<h2 id=\"i-16\">\u8907\u6570\u306e\u30b0\u30e9\u30d5\u3092\u63cf\u753b\u3059\u308b<\/h2>\n<p><strong>\u8907\u6570\u306e\u30b0\u30e9\u30d5\u3092\u4e26\u3079\u3066\u914d\u7f6e\u3059\u308b\u306b\u306f\u30b5\u30d6\u30d7\u30ed\u30c3\u30c8\u306b\u63cf\u753b\u3059\u308b\u3053\u3068\u3067\u51fa\u6765\u307e\u3059\u3002<\/strong><br>add_subplot\u95a2\u6570\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u3067\u8907\u6570\u63cf\u753b\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<p>\u307e\u305a\u3001\u5909\u6570 = plt.figure()\u3067\u56f3\u306e<a href=\"https:\/\/aiacademy.jp\/texts\/show\/?id=18&amp;section=%E3%82%AF%E3%83%A9%E3%82%B9\" target=\"_blank\" rel=\"noopener\">\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5316 (\u7121\u6599\u767b\u9332\u5f8c\u306b\u8aad\u3081\u307e\u3059)<\/a>\u3092\u884c\u3044\u307e\u3059\u3002<br>\u305d\u306e\u5f8c\u3001add_subplot()\u3059\u308b\u3053\u3068\u3067\u5b9f\u73fe\u53ef\u80fd\u3067\u3059\u3002<br>add_subplot\u95a2\u6570\u306b\u6e21\u3059\u5f15\u6570\u306b\u95a2\u3057\u3066\u3067\u3059\u304c\u3001add_subplot(\u884c\u6570, \u5217\u6570, \u756a\u53f7) \u3068\u3057\u307e\u3059\u3002<\/p>\n<pre><code>import matplotlib.pyplot as plt\nx1, y1 = range(0, 5), [10,41, 44,29, 85]\nx2, y2 = range(0, 5), [59,55,77,15,47]\n\nfig = plt.figure()\n\n# 1\u884c2\u5217\u306e1\u756a\u76ee\na1 = fig.add_subplot(1, 2, 1) # \u7b2c3\u5f15\u6570\u306e1\u306f\u5de6\u5074\u3092\u610f\u5473\u3057\u3066\u3044\u307e\u3059\na1.bar(x1, y1)\na1.set_title(\"A\")\n\na2 = fig.add_subplot(1, 2, 2) # \u7b2c3\u5f15\u6570\u306e2\u306f\u53f3\u5074\u3092\u610f\u5473\u3057\u3066\u3044\u307e\u3059\na2.bar(x2, y2)\na2.set_title(\"B\")\n\nplt.show()\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/camo.qiitausercontent.com\/2437c62d059ce89fd6a24ba975b8168d517d1f89\/68747470733a2f2f71696974612d696d6167652d73746f72652e73332e616d617a6f6e6177732e636f6d2f302f3137313731352f38336336386634312d666566622d393664342d396166392d3161343166636265373362622e706e67\" alt=\"\"><\/p>\n<h2 id=\"i-17\">\u307e\u3068\u3081<\/h2>\n<p>\u3053\u306e\u7ae0\u3067\u306f\u3001Matplotlib\u3067\u3088\u304f\u4f7f\u3046\u30e1\u30bd\u30c3\u30c9\u3092\u898b\u3066\u304d\u307e\u3057\u305f\u3002<br>Matplotlib\u306f\u3001\u30b0\u30e9\u30d5\u306e\u63cf\u753b\u3084\u30c7\u30fc\u30bf\u306e\u53ef\u8996\u5316\u3001\u6298\u308c\u7dda\u30b0\u30e9\u30d5\u3001\u30d2\u30b9\u30c8\u30b0\u30e9\u30e0\u3084\u6563\u5e03\u56f3\u306a\u3069\u8868\u73fe\u53ef\u80fd\u3067\u3059\u3002<br>\u624b\u5143\u306e\u30c7\u30fc\u30bf\u3092\u53ef\u8996\u5316\u3059\u308b\u6642\u306b\u5fc5\u9808\u306ePython\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3059\u306e\u3067\u4f7f\u3044\u3053\u306a\u305b\u308b\u3088\u3046\u306b\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<h2 id=\"i-18\">\u6f14\u7fd2\u554f\u984c<\/h2>\n<p>1 . NumPy\u3084math\u30e2\u30b8\u30e5\u30fc\u30eb\u306esin()\u3001cos()\u95a2\u6570\u3092\u4f7f\u3044\u3001Sin\u6ce2\u306e\u30b0\u30e9\u30d5\u3068Cos\u6ce2\u306e\u30b0\u30e9\u30d5\u3092\u63cf\u753b\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<br>NumPy\u306a\u3069\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u4f7f\u3063\u3066\u30c7\u30fc\u30bf\u3092\u4f5c\u3063\u3066\u3044\u305f\u3060\u3044\u3066\u3082\u4ed6\u306e\u65b9\u6cd5\u3067\u3082\u69cb\u3044\u307e\u305b\u3093\u3002<\/p>\n<p><a href=\"https:\/\/qiita.com\/AI_Academy\/private\/746ec6ff43bfcfc7244b\" target=\"_blank\" rel=\"noopener nofollow\">\u6f14\u7fd2\u554f\u984c\u56de\u7b54\u4f8b<\/a><\/p>\n<p><!-- wp:heading --><\/p>\n<h2 class=\"wp-block-heading\" id=\"i-19\">Python\u3092\u52b9\u7387\u3088\u304f\u5b66\u3076\u306b\u306f\uff1f<\/h2>\n<p><!-- \/wp:heading --><\/p>\n<p><!-- wp:paragraph --><\/p>\n<p>Matplotlib\u306e\u89e3\u8aac\u306b\u3064\u3044\u3066\u3001\u3044\u304b\u304c\u3067\u3057\u305f\u3067\u3057\u3087\u3046\u304b\uff1f<\/p>\n<p><!-- \/wp:paragraph --><\/p>\n<p><!-- wp:paragraph --><\/p>\n<p><a title=\"\" href=\"https:\/\/aiacademy.jp\/bootcamp\" target=\"_blank\" rel=\"noopener\">AI Academy Bootcamp<\/a> \u3067\u306fAI\u30fb\u30c7\u30fc\u30bf\u30b5\u30a4\u30a8\u30f3\u30b9\u3001\u6a5f\u68b0\u5b66\u7fd2\u306e\u5b9f\u8df5\u529b\u3092\u9ad8\u3081\u308b\u51684\u30b3\u30fc\u30b940\u6642\u9593\u4ee5\u4e0a\u306e\u52d5\u753b\u304c\u898b\u653e\u984c\uff01AI\u306e\u5b66\u7fd2\u306b\u5fc5\u9808\u306ePython\u306e\u5b66\u7fd2\u304b\u3089\u59cb\u307e\u308a\u3001\u30c7\u30fc\u30bf\u30b5\u30a4\u30a8\u30f3\u30b9\u30fb\u6a5f\u68b0\u5b66\u7fd2\u306a\u3069\u3001\u76ee\u7684\u306b\u5fdc\u3058\u305f\u5e45\u5e83\u3044\u5206\u91ce\u3092\u30ab\u30d0\u30fc\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><!-- \/wp:paragraph --><\/p>\n<p><!-- wp:paragraph --><\/p>\n<p>\u3053\u308c\u307e\u3067\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3092\u5b66\u3093\u3060\u3053\u3068\u304c\u306a\u3044\u65b9\u3084\u3001AI\u306b\u8208\u5473\u306e\u3042\u308b\u30a8\u30f3\u30b8\u30cb\u30a2\u306e\u65b9\u307e\u3067\u5e45\u5e83\u3044\u65b9\u304c\u30b9\u30ad\u30eb\u30a2\u30c3\u30d7\u3057\u3001AI\u30a8\u30f3\u30b8\u30cb\u30a2\u3084\u30c7\u30fc\u30bf\u30b5\u30a4\u30a8\u30f3\u30b9\u3001\u30c7\u30fc\u30bf\u30a2\u30ca\u30ea\u30b9\u30c8\u304b\u3089\u5927\u898f\u6a21\u8a00\u8a9e\u30e2\u30c7\u30eb\u30a8\u30f3\u30b8\u30cb\u30a2\u3092\u76ee\u6307\u3059\u30b3\u30fc\u30b9\u3082\u3054\u3056\u3044\u307e\u3059\u3002<\/p>\n<h2 id=\"i-20\">\u2728\u751f\u6210AI\u30b3\u30fc\u30b9 \u53d7\u8b1b\u304a\u7533\u8fbc\u307f\u53d7\u4ed8\u4e2d\uff01<\/h2>\n<p><!-- wp:paragraph --><\/p>\n<p>\u751f\u6210AI\u306e\u6982\u8981\u3084ChatGPT\u306e\u57fa\u790e\u64cd\u4f5c\u3001\u30d7\u30ed\u30f3\u30d7\u30c8\u30a8\u30f3\u30b8\u30cb\u30a2\u30ea\u30f3\u30b0\u306e\u57fa\u790e\u304b\u3089\u5b9f\u8df5\u307e\u3067\u5b66\u3079\u307e\u3059\u3002\u6f14\u7fd2\u8ab2\u984c\u3092\u901a\u3058\u3066\u3001\u3054\u81ea\u8eab\u306e\u696d\u52d9\u306b\u9069\u3057\u305f\u30d7\u30ed\u30f3\u30d7\u30c8\u3084\u30c4\u30fc\u30eb\u3092\u4f5c\u6210\u3057\u3001\u751f\u6210AI\u3092\u696d\u52d9\u306b\u6d3b\u7528\u3067\u304d\u308b\u30b9\u30ad\u30eb\u304c\u8eab\u306b\u3064\u304d\u307e\u3059\u3002<\/p>\n<p><!-- \/wp:paragraph --><\/p>\n<p><!-- wp:paragraph --><\/p>\n<p><strong>\u53d7\u8b1b\u7279\u5178<\/strong>\uff1a\u53d7\u8b1b\u671f\u9593\u4e2d\u300159\u7a2e\u985e\u306e\u5145\u5b9f\u3057\u305fAI Academy\u306e\u30aa\u30ea\u30b8\u30ca\u30eb\u30c6\u30ad\u30b9\u30c8\u3092\u4f7f\u3044\u306a\u304c\u3089\u5b66\u3093\u3067\u3044\u305f\u3060\u3051\u307e\u3059\u3002 \u4f8b\uff09\u300c\u6a5f\u68b0\u5b66\u7fd2\u306b\u5fc5\u8981\u306a\u6570\u5b66\u7de8\u300d\u300c\u6a5f\u68b0\u5b66\u7fd2\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u306e\u7406\u8ad6\u3068\u5b9f\u88c5\u7de8\u300d\u300c\u81ea\u7136\u8a00\u8a9e\u51e6\u7406\u7de8\u300d\u300c\u30d7\u30ed\u30f3\u30d7\u30c8\u30a8\u30f3\u30b8\u30cb\u30a2\u30ea\u30f3\u30b0\u5165\u9580\u7de8\u300d\u306a\u3069<\/p>\n<p><!-- \/wp:paragraph --><\/p>\n<p><!-- wp:image {\"id\":587,\"linkDestination\":\"custom\"} --><\/p>\n<p><a href=\"https:\/\/lin.ee\/3E4GzWk\" target=\"_blank\" rel=\"noreferrer noopener nofollow\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"347\" class=\"wp-image-6652\" src=\"https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2019\/11\/\u751f\u6210AI_\u30a6\u30a7\u30d3\u30ca\u30fc_0310-1024x347.png\" alt=\"\" srcset=\"https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2019\/11\/\u751f\u6210AI_\u30a6\u30a7\u30d3\u30ca\u30fc_0310-1024x347.png 1024w, https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2019\/11\/\u751f\u6210AI_\u30a6\u30a7\u30d3\u30ca\u30fc_0310-300x102.png 300w, https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2019\/11\/\u751f\u6210AI_\u30a6\u30a7\u30d3\u30ca\u30fc_0310-768x260.png 768w, https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2019\/11\/\u751f\u6210AI_\u30a6\u30a7\u30d3\u30ca\u30fc_0310-1536x521.png 1536w, https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2019\/11\/\u751f\u6210AI_\u30a6\u30a7\u30d3\u30ca\u30fc_0310-2048x694.png 2048w, https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2019\/11\/\u751f\u6210AI_\u30a6\u30a7\u30d3\u30ca\u30fc_0310-940x319.png 940w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\"><\/a><\/p>\n<p><!-- \/wp:image --><\/p>\n<p><!-- wp:heading --><\/p>\n<h2 class=\"wp-block-heading\" id=\"i-21\"><a title=\"\" href=\"https:\/\/aiacademy.jp\/media\/?p=263\" target=\"_blank\" rel=\"noopener\">\u30aa\u30b9\u30b9\u30e1\u8a18\u4e8b<\/a><\/h2>\n<p><!-- \/wp:heading --><\/p>\n<p><!-- wp:image {\"id\":2088,\"sizeSlug\":\"large\",\"linkDestination\":\"custom\"} --><\/p>\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/aiacademy.jp\/media\/?p=263\" target=\"_blank\" rel=\"noreferrer noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"568\" class=\"wp-image-2088\" src=\"https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2022\/02\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2022-02-14-23.04.37-1024x568.png\" alt=\"\" srcset=\"https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2022\/02\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2022-02-14-23.04.37-1024x568.png 1024w, https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2022\/02\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2022-02-14-23.04.37-300x166.png 300w, https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2022\/02\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2022-02-14-23.04.37-768x426.png 768w, https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2022\/02\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2022-02-14-23.04.37-1536x852.png 1536w, https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2022\/02\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2022-02-14-23.04.37-940x521.png 940w, https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2022\/02\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2022-02-14-23.04.37.png 1850w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\"><\/a><\/figure>\n<p><!-- \/wp:image --><\/p>","protected":false},"excerpt":{"rendered":"<p>\u76ee\u6b21 \u306f\u3058\u3081\u306b Matplotlib\u3068\u306f Matplotlib\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb Matplotlib\u306e\u4f7f\u3044\u65b9 \u6298\u308c\u7dda\u30b0\u30e9\u30d5 \u3010\u7121\u6599\u52d5\u753b\uff1a\u500d\u901f\u3067\u5b66\u3076\uff01\u751f\u6210AI\u3092\u6d3b\u7528\u3057\u305f\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u52c9\u5f37\u6cd5\uff08\u77ed\u7e2e\u7248\uff09\u3011 plot() \u68d2\u30b0\u30e9\u30d5 &#8230; <\/p>\n","protected":false},"author":1,"featured_media":5826,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[85,105,110],"tags":[],"class_list":{"0":"post-154","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-python","8":"category-105","9":"category-110"},"_links":{"self":[{"href":"https:\/\/aiacademy.jp\/media\/index.php?rest_route=\/wp\/v2\/posts\/154","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/aiacademy.jp\/media\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/aiacademy.jp\/media\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/aiacademy.jp\/media\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/aiacademy.jp\/media\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=154"}],"version-history":[{"count":71,"href":"https:\/\/aiacademy.jp\/media\/index.php?rest_route=\/wp\/v2\/posts\/154\/revisions"}],"predecessor-version":[{"id":7246,"href":"https:\/\/aiacademy.jp\/media\/index.php?rest_route=\/wp\/v2\/posts\/154\/revisions\/7246"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/aiacademy.jp\/media\/index.php?rest_route=\/wp\/v2\/media\/5826"}],"wp:attachment":[{"href":"https:\/\/aiacademy.jp\/media\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=154"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/aiacademy.jp\/media\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=154"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/aiacademy.jp\/media\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=154"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}