{"id":15584,"date":"2024-01-14T07:51:12","date_gmt":"2024-01-14T04:21:12","guid":{"rendered":"https:\/\/rasanegar.com\/blog\/matplotlib-bar-plot-%d8%a2%d9%85%d9%88%d8%b2%d8%b4-%d9%88-%d9%85%d8%ab%d8%a7%d9%84\/"},"modified":"2024-01-14T07:51:12","modified_gmt":"2024-01-14T04:21:12","slug":"matplotlib-bar-plot-%d8%a2%d9%85%d9%88%d8%b2%d8%b4-%d9%88-%d9%85%d8%ab%d8%a7%d9%84","status":"publish","type":"post","link":"https:\/\/rasanegaar.com\/blog\/matplotlib-bar-plot-%d8%a2%d9%85%d9%88%d8%b2%d8%b4-%d9%88-%d9%85%d8%ab%d8%a7%d9%84\/","title":{"rendered":"Matplotlib Bar Plot &#8211; \u0622\u0645\u0648\u0632\u0634 \u0648 \u0645\u062b\u0627\u0644"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_85 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\"><p class=\"ez-toc-title\" style=\"cursor:inherit\">\u0633\u0631\u0641\u0635\u0644\u0647\u0627\u06cc \u0645\u0637\u0644\u0628<\/p>\n<\/div><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/rasanegaar.com\/blog\/matplotlib-bar-plot-%d8%a2%d9%85%d9%88%d8%b2%d8%b4-%d9%88-%d9%85%d8%ab%d8%a7%d9%84\/#%d9%85%d8%b9%d8%b1%d9%81%db%8c\" >\u0645\u0639\u0631\u0641\u06cc<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/rasanegaar.com\/blog\/matplotlib-bar-plot-%d8%a2%d9%85%d9%88%d8%b2%d8%b4-%d9%88-%d9%85%d8%ab%d8%a7%d9%84\/#%d8%b7%d8%b1%d8%ad_%db%8c%da%a9_%d9%82%d8%b7%d8%b9%d9%87_%d9%86%d9%88%d8%a7%d8%b1_%d8%af%d8%b1_matplotlib\" >\u0637\u0631\u062d \u06cc\u06a9 \u0642\u0637\u0639\u0647 \u0646\u0648\u0627\u0631 \u062f\u0631 Matplotlib<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/rasanegaar.com\/blog\/matplotlib-bar-plot-%d8%a2%d9%85%d9%88%d8%b2%d8%b4-%d9%88-%d9%85%d8%ab%d8%a7%d9%84\/#%d8%b7%d8%b1%d8%ad_%d9%86%d9%88%d8%a7%d8%b1_%d8%a7%d9%81%d9%82%db%8c_%d8%af%d8%b1_matplotlib\" >\u0637\u0631\u062d \u0646\u0648\u0627\u0631 \u0627\u0641\u0642\u06cc \u062f\u0631 Matplotlib<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/rasanegaar.com\/blog\/matplotlib-bar-plot-%d8%a2%d9%85%d9%88%d8%b2%d8%b4-%d9%88-%d9%85%d8%ab%d8%a7%d9%84\/#%d8%aa%d8%ba%db%8c%db%8c%d8%b1_%d8%b1%d9%86%da%af_%d9%86%d9%85%d9%88%d8%af%d8%a7%d8%b1_%d9%86%d9%88%d8%a7%d8%b1_%d8%af%d8%b1_matplotlib\" >\u062a\u063a\u06cc\u06cc\u0631 \u0631\u0646\u06af \u0646\u0645\u0648\u062f\u0627\u0631 \u0646\u0648\u0627\u0631 \u062f\u0631 Matplotlib<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/rasanegaar.com\/blog\/matplotlib-bar-plot-%d8%a2%d9%85%d9%88%d8%b2%d8%b4-%d9%88-%d9%85%d8%ab%d8%a7%d9%84\/#%d9%86%d9%85%d9%88%d8%af%d8%a7%d8%b1_%d9%86%d9%88%d8%a7%d8%b1_%d8%a8%d8%a7_%d9%86%d9%88%d8%a7%d8%b1%d9%87%d8%a7%db%8c_%d8%ae%d8%b7%d8%a7_%d8%af%d8%b1_matplotlib\" >\u0646\u0645\u0648\u062f\u0627\u0631 \u0646\u0648\u0627\u0631 \u0628\u0627 \u0646\u0648\u0627\u0631\u0647\u0627\u06cc \u062e\u0637\u0627 \u062f\u0631 Matplotlib<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/rasanegaar.com\/blog\/matplotlib-bar-plot-%d8%a2%d9%85%d9%88%d8%b2%d8%b4-%d9%88-%d9%85%d8%ab%d8%a7%d9%84\/#plot_stacked_bar_plot_%d8%af%d8%b1_matplotlib\" >Plot Stacked Bar Plot \u062f\u0631 Matplotlib<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/rasanegaar.com\/blog\/matplotlib-bar-plot-%d8%a2%d9%85%d9%88%d8%b2%d8%b4-%d9%88-%d9%85%d8%ab%d8%a7%d9%84\/#%d9%86%d8%aa%db%8c%d8%ac%d9%87\" >\u0646\u062a\u06cc\u062c\u0647<\/a><\/li><\/ul><\/nav><\/div>\n<span class=\"span-reading-time rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\">\u0632\u0645\u0627\u0646 \u0644\u0627\u0632\u0645 \u0628\u0631\u0627\u06cc \u0645\u0637\u0627\u0644\u0639\u0647: <\/span> <span class=\"rt-time\"> 5<\/span> <span class=\"rt-label rt-postfix\">\u062f\u0642\u06cc\u0642\u0647<\/span><\/span><p> <br \/>\n<\/p>\n<div><noscript><\/noscript><\/p>\n<h2 id=\"introduction\"><span class=\"ez-toc-section\" id=\"%d9%85%d8%b9%d8%b1%d9%81%db%8c\"><\/span>\u0645\u0639\u0631\u0641\u06cc<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><em>Matplotlib<\/em> \u06cc\u06a9\u06cc \u0627\u0632 \u067e\u0631\u06a9\u0627\u0631\u0628\u0631\u062f\u062a\u0631\u06cc\u0646 \u06a9\u062a\u0627\u0628\u062e\u0627\u0646\u0647 \u0647\u0627\u06cc \u062a\u062c\u0633\u0645 \u062f\u0627\u062f\u0647 \u062f\u0631 \u067e\u0627\u06cc\u062a\u0648\u0646 \u0627\u0633\u062a.  \u0627\u0632 \u062a\u062c\u0633\u0645 \u0647\u0627\u06cc \u0633\u0627\u062f\u0647 \u06af\u0631\u0641\u062a\u0647 \u062a\u0627 \u067e\u06cc\u0686\u06cc\u062f\u0647\u060c \u0627\u06cc\u0646 \u06a9\u062a\u0627\u0628\u062e\u0627\u0646\u0647 \u0628\u0631\u0627\u06cc \u0628\u06cc\u0634\u062a\u0631 \u0627\u0641\u0631\u0627\u062f \u0627\u0633\u062a.<\/p>\n<p>\u062f\u0631 \u0627\u06cc\u0646 \u0622\u0645\u0648\u0632\u0634\u060c \u0631\u0648\u0634 \u0627\u0646\u062c\u0627\u0645 \u0627\u06cc\u0646 \u06a9\u0627\u0631 \u0631\u0627 \u0628\u0631\u0631\u0633\u06cc \u062e\u0648\u0627\u0647\u06cc\u0645 \u06a9\u0631\u062f <em>\u0637\u0631\u062d \u06cc\u06a9 \u0637\u0631\u062d \u0646\u0648\u0627\u0631 \u062f\u0631 Matplotlib<\/em>.<\/p>\n<p>\u0646\u0645\u0648\u062f\u0627\u0631\u0647\u0627\u06cc \u0645\u06cc\u0644\u0647 \u0627\u06cc \u0645\u0642\u0627\u062f\u06cc\u0631 \u0639\u062f\u062f\u06cc \u0631\u0627 \u0646\u0645\u0627\u06cc\u0634 \u0645\u06cc \u062f\u0647\u0646\u062f \u0631\u0648\u06cc \u06cc\u06a9 \u0645\u062d\u0648\u0631 \u0648 \u0645\u062a\u063a\u06cc\u0631\u0647\u0627\u06cc \u0637\u0628\u0642\u0647 \u0628\u0646\u062f\u06cc \u0631\u0648\u06cc \u0627\u0632 \u0633\u0648\u06cc \u062f\u06cc\u06af\u0631\u060c \u0628\u0647 \u0634\u0645\u0627 \u0627\u0645\u06a9\u0627\u0646 \u0645\u06cc \u062f\u0647\u062f \u0628\u0628\u06cc\u0646\u06cc\u062f \u06a9\u0647 \u0686\u0646\u062f \u0645\u0648\u0631\u062f \u0628\u0631\u0627\u06cc \u062f\u0633\u062a\u0647 \u0647\u0627\u06cc \u0645\u062e\u062a\u0644\u0641 \u0648\u062c\u0648\u062f \u062f\u0627\u0631\u062f.<\/p>\n<blockquote>\n<p>\u0646\u0645\u0648\u062f\u0627\u0631\u0647\u0627\u06cc \u0645\u06cc\u0644\u0647 \u0627\u06cc \u0631\u0627 \u0645\u06cc \u062a\u0648\u0627\u0646 \u0628\u0631\u0627\u06cc \u062a\u062c\u0633\u0645 \u06cc\u06a9 \u0633\u0631\u06cc \u0632\u0645\u0627\u0646\u06cc \u0648 \u0647\u0645\u0686\u0646\u06cc\u0646 \u062f\u0627\u062f\u0647 \u0647\u0627\u06cc \u0637\u0628\u0642\u0647 \u0628\u0646\u062f\u06cc \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0631\u062f.<\/p>\n<\/blockquote>\n<h2 id=\"plotabarplotinmatplotlib\"><span class=\"ez-toc-section\" id=\"%d8%b7%d8%b1%d8%ad_%db%8c%da%a9_%d9%82%d8%b7%d8%b9%d9%87_%d9%86%d9%88%d8%a7%d8%b1_%d8%af%d8%b1_matplotlib\"><\/span>\u0637\u0631\u062d \u06cc\u06a9 \u0642\u0637\u0639\u0647 \u0646\u0648\u0627\u0631 \u062f\u0631 Matplotlib<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u062a\u0631\u0633\u06cc\u0645 \u0646\u0642\u0634\u0647 \u0646\u0648\u0627\u0631 \u062f\u0631 Matplotlib \u0628\u0647 \u0622\u0633\u0627\u0646\u06cc \u0641\u0631\u0627\u062e\u0648\u0627\u0646\u06cc \u0627\u0633\u062a <code>bar()<\/code> \u062a\u0627\u0628\u0639 \u0631\u0648\u06cc \u0646\u0645\u0648\u0646\u0647 PyPlot\u060c \u0648 \u0639\u0628\u0648\u0631 \u0627\u0632 \u0645\u062a\u063a\u06cc\u0631\u0647\u0627\u06cc \u062f\u0633\u062a\u0647 \u0628\u0646\u062f\u06cc \u0648 \u0639\u062f\u062f\u06cc \u06a9\u0647 \u0645\u06cc \u062e\u0648\u0627\u0647\u06cc\u0645 \u062a\u062c\u0633\u0645 \u06a9\u0646\u06cc\u0645.<\/p>\n<pre><code class=\"hljs\"><span class=\"hljs-keyword\">import<\/span> matplotlib.pyplot <span class=\"hljs-keyword\">as<\/span> plt\n\nx = (<span class=\"hljs-string\">'A'<\/span>, <span class=\"hljs-string\">'B'<\/span>, <span class=\"hljs-string\">'C'<\/span>)\ny = (<span class=\"hljs-number\">1<\/span>, <span class=\"hljs-number\">5<\/span>, <span class=\"hljs-number\">3<\/span>)\n\nplt.bar(x, y)\nplt.show()\n<\/code><\/pre>\n<p>\u062f\u0631 \u0627\u06cc\u0646\u062c\u0627\u060c \u0645\u0627 \u0686\u0646\u062f \u0645\u062a\u063a\u06cc\u0631 \u0637\u0628\u0642\u0647 \u0628\u0646\u062f\u06cc \u0634\u062f\u0647 \u062f\u0631 \u06cc\u06a9 \u0644\u06cc\u0633\u062a \u062f\u0627\u0631\u06cc\u0645 &#8211; <code>A<\/code>\u060c <code>B<\/code> \u0648 <code>C<\/code>.  \u0645\u0627 \u0647\u0645\u0686\u0646\u06cc\u0646 \u0686\u0646\u062f \u0645\u062a\u063a\u06cc\u0631 \u067e\u06cc\u0648\u0633\u062a\u0647 \u0631\u0627 \u062f\u0631 \u0644\u06cc\u0633\u062a \u062f\u06cc\u06af\u0631\u06cc \u062f\u0627\u0631\u06cc\u0645 &#8211; <code>1<\/code>\u060c <code>5<\/code> \u0648 <code>3<\/code>.  \u0633\u067e\u0633 \u0631\u0627\u0628\u0637\u0647 \u0628\u06cc\u0646 \u0627\u06cc\u0646 \u062f\u0648 \u062f\u0631 \u06cc\u06a9 Bar Plot \u0628\u0627 \u0627\u0631\u0633\u0627\u0644 \u0627\u06cc\u0646 \u062f\u0648 \u0644\u06cc\u0633\u062a \u0628\u0647 \u062a\u0635\u0648\u06cc\u0631 \u06a9\u0634\u06cc\u062f\u0647 \u0645\u06cc \u0634\u0648\u062f <code>plt.bar()<\/code>.<\/p>\n<p>\u0627\u06cc\u0646 \u0645\u0646\u062c\u0631 \u0628\u0647 \u06cc\u06a9 \u0646\u0645\u0648\u062f\u0627\u0631 \u0645\u06cc\u0644\u0647 \u0627\u06cc \u062a\u0645\u06cc\u0632 \u0648 \u0633\u0627\u062f\u0647 \u0645\u06cc \u0634\u0648\u062f:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/rasanegar.com\/blog\/wp-content\/uploads\/2024\/01\/matplotlib-bar-plot-tutorial-and-examples-1.png\" alt=\"\u0646\u0645\u0648\u062f\u0627\u0631 \u0646\u0648\u0627\u0631 \u067e\u0627\u06cc\u0647 \u062f\u0631 matplotlib\" title=\"\"><\/p>\n<h2 id=\"plotahorizontalbarplotinmatplotlib\"><span class=\"ez-toc-section\" id=\"%d8%b7%d8%b1%d8%ad_%d9%86%d9%88%d8%a7%d8%b1_%d8%a7%d9%81%d9%82%db%8c_%d8%af%d8%b1_matplotlib\"><\/span>\u0637\u0631\u062d \u0646\u0648\u0627\u0631 \u0627\u0641\u0642\u06cc \u062f\u0631 Matplotlib<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u0627\u063a\u0644\u0628\u060c \u0645\u0645\u06a9\u0646 \u0627\u0633\u062a \u0628\u062e\u0648\u0627\u0647\u06cc\u0645 \u0628\u0647 \u062c\u0627\u06cc \u0639\u0645\u0648\u062f\u06cc\u060c \u0646\u0645\u0648\u062f\u0627\u0631 \u0646\u0648\u0627\u0631 \u0631\u0627 \u0628\u0647 \u0635\u0648\u0631\u062a \u0627\u0641\u0642\u06cc \u062a\u0631\u0633\u06cc\u0645 \u06a9\u0646\u06cc\u0645.  \u0627\u06cc\u0646 \u0628\u0647 \u0631\u0627\u062d\u062a\u06cc \u0628\u0627 \u062a\u063a\u06cc\u06cc\u0631 \u062f\u0627\u062f\u0646 \u0642\u0627\u0628\u0644 \u062f\u0633\u062a\u06cc\u0627\u0628\u06cc \u0627\u0633\u062a <code>plt.bar()<\/code> \u062a\u0645\u0627\u0633 \u0628\u0627 <code>plt.barh()<\/code> \u0632\u0646\u06af \u0632\u062f\u0646:<\/p>\n<pre><code class=\"hljs\"><span class=\"hljs-keyword\">import<\/span> matplotlib.pyplot <span class=\"hljs-keyword\">as<\/span> plt\n\nx = (<span class=\"hljs-string\">'A'<\/span>, <span class=\"hljs-string\">'B'<\/span>, <span class=\"hljs-string\">'C'<\/span>)\ny = (<span class=\"hljs-number\">1<\/span>, <span class=\"hljs-number\">5<\/span>, <span class=\"hljs-number\">3<\/span>)\n\nplt.barh(x, y)\nplt.show()\n<\/code><\/pre>\n<p>\u0627\u06cc\u0646 \u0645\u0646\u062c\u0631 \u0628\u0647 \u06cc\u06a9 \u0646\u0645\u0648\u062f\u0627\u0631 \u0646\u0648\u0627\u0631 \u0627\u0641\u0642\u06cc \u0645\u06cc \u0634\u0648\u062f:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/rasanegar.com\/blog\/wp-content\/uploads\/2024\/01\/matplotlib-bar-plot-tutorial-and-examples-2.png\" alt=\"\u0646\u0645\u0648\u062f\u0627\u0631 \u0646\u0648\u0627\u0631 \u0627\u0641\u0642\u06cc \u062f\u0631 matplotlib\" title=\"\"><\/p>\n<h2 id=\"changebarplotcolorinmatplotlib\"><span class=\"ez-toc-section\" id=\"%d8%aa%d8%ba%db%8c%db%8c%d8%b1_%d8%b1%d9%86%da%af_%d9%86%d9%85%d9%88%d8%af%d8%a7%d8%b1_%d9%86%d9%88%d8%a7%d8%b1_%d8%af%d8%b1_matplotlib\"><\/span>\u062a\u063a\u06cc\u06cc\u0631 \u0631\u0646\u06af \u0646\u0645\u0648\u062f\u0627\u0631 \u0646\u0648\u0627\u0631 \u062f\u0631 Matplotlib<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u062a\u063a\u06cc\u06cc\u0631 \u0631\u0646\u06af \u062e\u0648\u062f \u0646\u0648\u0627\u0631\u0647\u0627 \u0628\u0647 \u0622\u0633\u0627\u0646\u06cc \u062a\u0646\u0638\u06cc\u0645 \u0622\u0646 \u0627\u0633\u062a <code>color<\/code> \u0622\u0631\u06af\u0648\u0645\u0627\u0646 \u0628\u0627 \u0644\u06cc\u0633\u062a\u06cc \u0627\u0632 \u0631\u0646\u06af \u0647\u0627  \u0627\u06af\u0631 \u062a\u0639\u062f\u0627\u062f \u0645\u06cc\u0644\u0647\u200c\u0647\u0627 \u0628\u06cc\u0634\u062a\u0631 \u0627\u0632 \u0631\u0646\u06af\u200c\u0647\u0627 \u062f\u0631 \u0644\u06cc\u0633\u062a \u0628\u0627\u0634\u062f\u060c \u062f\u0648\u0628\u0627\u0631\u0647 \u0627\u0632 \u0631\u0646\u06af \u0627\u0648\u0644 \u0627\u0639\u0645\u0627\u0644 \u0645\u06cc\u200c\u0634\u0648\u0646\u062f:<\/p>\n<pre><code class=\"hljs\"><span class=\"hljs-keyword\">import<\/span> matplotlib.pyplot <span class=\"hljs-keyword\">as<\/span> plt\n\nx = (<span class=\"hljs-string\">'A'<\/span>, <span class=\"hljs-string\">'B'<\/span>, <span class=\"hljs-string\">'C'<\/span>)\ny = (<span class=\"hljs-number\">1<\/span>, <span class=\"hljs-number\">5<\/span>, <span class=\"hljs-number\">3<\/span>)\n\nplt.bar(x, y, color=(<span class=\"hljs-string\">'red'<\/span>, <span class=\"hljs-string\">'blue'<\/span>, <span class=\"hljs-string\">'green'<\/span>))\nplt.show()\n<\/code><\/pre>\n<p>\u0627\u06a9\u0646\u0648\u0646\u060c \u0645\u0627 \u06cc\u06a9 \u0646\u0648\u0627\u0631 \u0631\u0646\u06af\u06cc \u0632\u06cc\u0628\u0627 \u062f\u0627\u0631\u06cc\u0645:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/rasanegar.com\/blog\/wp-content\/uploads\/2024\/01\/matplotlib-bar-plot-tutorial-and-examples-3.png\" alt=\"\u062a\u063a\u06cc\u06cc\u0631 \u0631\u0646\u06af \u0646\u0645\u0648\u062f\u0627\u0631 \u0646\u0648\u0627\u0631 \u062f\u0631 matplotlib\" title=\"\"><\/p>\n<p>\u0627\u0644\u0628\u062a\u0647 \u0645\u06cc \u062a\u0648\u0627\u0646\u06cc\u062f \u0627\u0632 \u0646\u0633\u062e\u0647 \u0647\u0627\u06cc \u06a9\u0648\u062a\u0627\u0647 \u06cc\u0627 \u062d\u062a\u06cc \u06a9\u062f\u0647\u0627\u06cc HTML \u0646\u06cc\u0632 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u062f:<\/p>\n<pre><code class=\"hljs\">plt.bar(x, y, color=(<span class=\"hljs-string\">'red'<\/span>, <span class=\"hljs-string\">'blue'<\/span>, <span class=\"hljs-string\">'green'<\/span>))\nplt.bar(x, y, color=(<span class=\"hljs-string\">'r'<\/span>, <span class=\"hljs-string\">'b'<\/span>, <span class=\"hljs-string\">'g'<\/span>))\nplt.bar(x, y, color=(<span class=\"hljs-string\">'#ff0000'<\/span>, <span class=\"hljs-string\">'#00ff00'<\/span>, <span class=\"hljs-string\">'#0000ff'<\/span>))\nplt.show()\n<\/code><\/pre>\n<p>\u06cc\u0627 \u062d\u062a\u06cc \u0645\u06cc \u062a\u0648\u0627\u0646\u06cc\u062f \u06cc\u06a9 \u0645\u0642\u062f\u0627\u0631 \u0627\u0633\u06a9\u0627\u0644\u0631 \u0648\u0627\u062d\u062f \u0642\u0631\u0627\u0631 \u062f\u0647\u06cc\u062f \u062a\u0627 \u0622\u0646 \u0631\u0627 \u062f\u0631 \u0647\u0645\u0647 \u0646\u0648\u0627\u0631\u0647\u0627 \u0627\u0639\u0645\u0627\u0644 \u06a9\u0646\u06cc\u062f:<\/p>\n<pre><code class=\"hljs\">plt.bar(x, y, color=<span class=\"hljs-string\">'green'<\/span>)\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/rasanegar.com\/blog\/wp-content\/uploads\/2024\/01\/matplotlib-bar-plot-tutorial-and-examples-4.png\" alt=\"\u062a\u063a\u06cc\u06cc\u0631 \u0631\u0646\u06af \u0646\u0645\u0648\u062f\u0627\u0631 \u0646\u0648\u0627\u0631 \u062f\u0631 matplotlib\" title=\"\"><\/p>\n<h2 id=\"barplotwitherrorbarsinmatplotlib\"><span class=\"ez-toc-section\" id=\"%d9%86%d9%85%d9%88%d8%af%d8%a7%d8%b1_%d9%86%d9%88%d8%a7%d8%b1_%d8%a8%d8%a7_%d9%86%d9%88%d8%a7%d8%b1%d9%87%d8%a7%db%8c_%d8%ae%d8%b7%d8%a7_%d8%af%d8%b1_matplotlib\"><\/span>\u0646\u0645\u0648\u062f\u0627\u0631 \u0646\u0648\u0627\u0631 \u0628\u0627 \u0646\u0648\u0627\u0631\u0647\u0627\u06cc \u062e\u0637\u0627 \u062f\u0631 Matplotlib<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u0647\u0646\u06af\u0627\u0645\u06cc \u06a9\u0647 \u0645\u0642\u0627\u062f\u06cc\u0631 \u0645\u06cc\u0627\u0646\u06af\u06cc\u0646 \u0644\u06cc\u0633\u062a \u0647\u0627 \u0631\u0627 \u062a\u0631\u0633\u06cc\u0645 \u0645\u06cc \u06a9\u0646\u06cc\u062f\u060c \u06a9\u0647 \u06cc\u06a9 \u0628\u0631\u0646\u0627\u0645\u0647 \u0645\u0639\u0645\u0648\u0644 \u0628\u0631\u0627\u06cc \u0646\u0648\u0627\u0631 Plots \u0627\u0633\u062a\u060c \u0645\u0642\u062f\u0627\u0631\u06cc \u0641\u0636\u0627\u06cc \u062e\u0637\u0627 \u062e\u0648\u0627\u0647\u06cc\u062f \u062f\u0627\u0634\u062a.  \u062a\u0631\u0633\u06cc\u0645 \u0646\u0648\u0627\u0631\u0647\u0627\u06cc \u062e\u0637\u0627 \u0628\u0633\u06cc\u0627\u0631 \u0645\u0641\u06cc\u062f \u0627\u0633\u062a \u062a\u0627 \u0628\u0647 \u0646\u0627\u0638\u0631\u0627\u0646 \u062f\u06cc\u06af\u0631 \u0648 \u062e\u0648\u062f\u062a\u0627\u0646 \u0627\u062c\u0627\u0632\u0647 \u062f\u0647\u06cc\u062f \u062a\u0627 \u0628\u062f\u0627\u0646\u0646\u062f \u0627\u06cc\u0646 \u0627\u0628\u0632\u0627\u0631\u0647\u0627 \u0686\u0642\u062f\u0631 \u0635\u0627\u062f\u0642 \u0647\u0633\u062a\u0646\u062f \u0648 \u06a9\u062f\u0627\u0645 \u0627\u0646\u062d\u0631\u0627\u0641 \u0645\u0648\u0631\u062f \u0627\u0646\u062a\u0638\u0627\u0631 \u0627\u0633\u062a.<\/p>\n<p>\u0628\u0631\u0627\u06cc \u0627\u06cc\u0646\u060c \u0628\u06cc\u0627\u06cc\u06cc\u062f \u06cc\u06a9 \u0645\u062c\u0645\u0648\u0639\u0647 \u062f\u0627\u062f\u0647 \u0628\u0627 \u0645\u0642\u0627\u062f\u06cc\u0631\u06cc \u0628\u0633\u0627\u0632\u06cc\u0645\u060c \u0645\u06cc\u0627\u0646\u06af\u06cc\u0646 \u0648 \u0627\u0646\u062d\u0631\u0627\u0641 \u0627\u0633\u062a\u0627\u0646\u062f\u0627\u0631\u062f \u0622\u0646\u0647\u0627 \u0631\u0627 \u0628\u0627 NumPy \u0645\u062d\u0627\u0633\u0628\u0647 \u06a9\u0646\u06cc\u0645 \u0648 \u0622\u0646\u0647\u0627 \u0631\u0627 \u0628\u0627 \u0646\u0648\u0627\u0631\u0647\u0627\u06cc \u062e\u0637\u0627 \u0631\u0633\u0645 \u06a9\u0646\u06cc\u0645:<\/p>\n<pre><code class=\"hljs\"><span class=\"hljs-keyword\">import<\/span> matplotlib.pyplot <span class=\"hljs-keyword\">as<\/span> plt\n<span class=\"hljs-keyword\">import<\/span> numpy <span class=\"hljs-keyword\">as<\/span> np\n\nx = np.array((<span class=\"hljs-number\">4<\/span>, <span class=\"hljs-number\">5<\/span>, <span class=\"hljs-number\">6<\/span>, <span class=\"hljs-number\">3<\/span>, <span class=\"hljs-number\">6<\/span>, <span class=\"hljs-number\">5<\/span>, <span class=\"hljs-number\">7<\/span>, <span class=\"hljs-number\">3<\/span>, <span class=\"hljs-number\">4<\/span>, <span class=\"hljs-number\">5<\/span>))\ny = np.array((<span class=\"hljs-number\">3<\/span>, <span class=\"hljs-number\">4<\/span>, <span class=\"hljs-number\">1<\/span>, <span class=\"hljs-number\">3<\/span>, <span class=\"hljs-number\">2<\/span>, <span class=\"hljs-number\">3<\/span>, <span class=\"hljs-number\">3<\/span>, <span class=\"hljs-number\">1<\/span>, <span class=\"hljs-number\">2<\/span>, <span class=\"hljs-number\">3<\/span>))\nz = np.array((<span class=\"hljs-number\">6<\/span>, <span class=\"hljs-number\">9<\/span>, <span class=\"hljs-number\">8<\/span>, <span class=\"hljs-number\">7<\/span>, <span class=\"hljs-number\">9<\/span>, <span class=\"hljs-number\">8<\/span>, <span class=\"hljs-number\">9<\/span>, <span class=\"hljs-number\">6<\/span>, <span class=\"hljs-number\">8<\/span>, <span class=\"hljs-number\">7<\/span>))\n\nx_mean = np.mean(x)\ny_mean = np.mean(y)\nz_mean = np.mean(z)\n\nx_deviation = np.std(x)\ny_deviation = np.std(y)\nz_deviation = np.std(z)\n\nbars = (x_mean, y_mean, z_mean)\nbar_categories = (<span class=\"hljs-string\">'X'<\/span>, <span class=\"hljs-string\">'Y'<\/span>, <span class=\"hljs-string\">'Z'<\/span>)\nerror_bars = (x_deviation, y_deviation, z_deviation)\n\nplt.bar(bar_categories, bars, yerr=error_bars)\nplt.show()\n<\/code><\/pre>\n<p>\u062f\u0631 \u0627\u06cc\u0646\u062c\u0627\u060c \u0645\u0627 \u0633\u0647 \u0645\u062c\u0645\u0648\u0639\u0647 \u062f\u0627\u062f\u0647 \u062c\u0639\u0644\u06cc \u0628\u0627 \u0686\u0646\u062f\u06cc\u0646 \u0645\u0642\u062f\u0627\u0631 \u0627\u06cc\u062c\u0627\u062f \u06a9\u0631\u062f\u0647\u200c\u0627\u06cc\u0645.  \u0645\u0627 \u0645\u0642\u0627\u062f\u06cc\u0631 \u0645\u06cc\u0627\u0646\u06af\u06cc\u0646 \u0647\u0631 \u06cc\u06a9 \u0627\u0632 \u0627\u06cc\u0646 \u0644\u06cc\u0633\u062a \u0647\u0627 \u0631\u0627 \u062a\u062c\u0633\u0645 \u062e\u0648\u0627\u0647\u06cc\u0645 \u06a9\u0631\u062f.  \u0628\u0627 \u0627\u06cc\u0646 \u062d\u0627\u0644\u060c \u0627\u0632 \u0622\u0646\u062c\u0627\u06cc\u06cc \u06a9\u0647 \u0645\u06cc\u0627\u0646\u06af\u06cc\u0646\u200c\u0647\u0627 \u0648 \u0647\u0645\u0686\u0646\u06cc\u0646 \u0645\u06cc\u0627\u0646\u06af\u06cc\u0646\u200c\u0647\u0627 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u0646\u062f \u062d\u0633 \u0646\u0627\u062f\u0631\u0633\u062a\u06cc \u0627\u0632 \u062f\u0642\u062a \u0631\u0627 \u0627\u0631\u0627\u0626\u0647 \u062f\u0647\u0646\u062f\u060c \u0645\u0627 \u0627\u0646\u062d\u0631\u0627\u0641 \u0627\u0633\u062a\u0627\u0646\u062f\u0627\u0631\u062f \u0627\u06cc\u0646 \u0645\u062c\u0645\u0648\u0639\u0647\u200c\u0647\u0627\u06cc \u062f\u0627\u062f\u0647 \u0631\u0627 \u0646\u06cc\u0632 \u0645\u062d\u0627\u0633\u0628\u0647 \u0645\u06cc\u200c\u06a9\u0646\u06cc\u0645 \u062a\u0627 \u0628\u062a\u0648\u0627\u0646\u06cc\u0645 \u0622\u0646\u200c\u0647\u0627 \u0631\u0627 \u0628\u0647 \u0639\u0646\u0648\u0627\u0646 \u0646\u0648\u0627\u0631 \u062e\u0637\u0627 \u0627\u0636\u0627\u0641\u0647 \u06a9\u0646\u06cc\u0645.<\/p>\n<p>\u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 NumPy <code>mean()<\/code> \u0648 <code>std()<\/code> \u062a\u0648\u0627\u0628\u0639\u060c \u0627\u06cc\u0646 \u06cc\u06a9 \u0646\u0633\u06cc\u0645 \u0627\u0633\u062a.  \u0633\u067e\u0633\u060c \u0645\u0642\u0627\u062f\u06cc\u0631 \u0646\u0648\u0627\u0631 \u0631\u0627 \u062f\u0631 \u06cc\u06a9 \u0628\u0633\u062a\u0647 \u0628\u0646\u062f\u06cc \u06a9\u0631\u062f\u0647 \u0627\u06cc\u0645 <code>bars<\/code> \u0644\u06cc\u0633\u062a\u060c \u0646\u0627\u0645 \u0646\u0648\u0627\u0631\u0647\u0627 \u0628\u0631\u0627\u06cc \u06cc\u06a9 \u062a\u062c\u0631\u0628\u0647 \u06a9\u0627\u0631\u0628\u0631\u06cc \u062e\u0648\u0628 \u062f\u0631 <code>bar_categories<\/code> \u0648 \u062f\u0631 \u0646\u0647\u0627\u06cc\u062a &#8211; \u0645\u0642\u0627\u062f\u06cc\u0631 \u0627\u0646\u062d\u0631\u0627\u0641 \u0627\u0633\u062a\u0627\u0646\u062f\u0627\u0631\u062f \u0628\u0647 an <code>error_bars<\/code> \u0641\u0647\u0631\u0633\u062a<\/p>\n<p>\u0628\u0631\u0627\u06cc \u062a\u062c\u0633\u0645 \u0627\u06cc\u0646 \u0645\u0648\u0636\u0648\u0639\u060c \u0628\u0647 \u0637\u0648\u0631 \u0645\u0646\u0638\u0645 \u062a\u0645\u0627\u0633 \u0645\u06cc\u200c\u06af\u06cc\u0631\u06cc\u0645 <code>bar()<\/code> \u062a\u0627\u0628\u0639\u060c \u0639\u0628\u0648\u0631 \u062f\u0631 <code>bar_categories<\/code> (\u0645\u0642\u0627\u062f\u06cc\u0631 \u0637\u0628\u0642\u0647 \u0628\u0646\u062f\u06cc) \u0648 <code>bars<\/code> (\u0645\u0642\u0627\u062f\u06cc\u0631 \u067e\u06cc\u0648\u0633\u062a\u0647)\u060c \u062f\u0631 \u06a9\u0646\u0627\u0631 <code>yerr<\/code> \u0628\u062d\u062b \u0648 \u062c\u062f\u0644.<\/p>\n<p>\u0627\u0632 \u0622\u0646\u062c\u0627\u06cc\u06cc \u06a9\u0647 \u0645\u0627 \u0628\u0647 \u0635\u0648\u0631\u062a \u0639\u0645\u0648\u062f\u06cc \u0631\u0633\u0645 \u0645\u06cc \u06a9\u0646\u06cc\u0645\u060c \u0627\u0632 \u0622\u0646 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0645\u06cc \u06a9\u0646\u06cc\u0645 <code>yerr<\/code> \u0628\u062d\u062b \u0648 \u062c\u062f\u0644.  \u0627\u06af\u0631 \u0628\u0647 \u0635\u0648\u0631\u062a \u0627\u0641\u0642\u06cc \u062a\u0631\u0633\u06cc\u0645 \u0645\u06cc \u06a9\u0631\u062f\u06cc\u0645\u060c \u0627\u0632 \u0622\u0646 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0645\u06cc \u06a9\u0631\u062f\u06cc\u0645 <code>xerr<\/code> \u0628\u062d\u062b \u0648 \u062c\u062f\u0644.  \u062f\u0631 \u0627\u06cc\u0646\u062c\u0627\u060c \u0645\u0627 \u0627\u0637\u0644\u0627\u0639\u0627\u062a \u0645\u0631\u0628\u0648\u0637 \u0628\u0647 \u0646\u0648\u0627\u0631\u0647\u0627\u06cc \u062e\u0637\u0627 \u0631\u0627 \u0627\u0631\u0627\u0626\u0647 \u06a9\u0631\u062f\u0647 \u0627\u06cc\u0645.<\/p>\n<p>\u0627\u06cc\u0646 \u062f\u0631 \u0646\u0647\u0627\u06cc\u062a \u0645\u0646\u062c\u0631 \u0628\u0647 \u0627\u06cc\u0646 \u0645\u06cc \u0634\u0648\u062f:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/rasanegar.com\/blog\/wp-content\/uploads\/2024\/01\/matplotlib-bar-plot-tutorial-and-examples-5.png\" alt=\"\u0646\u0645\u0648\u062f\u0627\u0631 \u0646\u0648\u0627\u0631 \u0628\u0627 \u0646\u0648\u0627\u0631\u0647\u0627\u06cc \u062e\u0637\u0627 \u062f\u0631 matplotlib\" title=\"\"><\/p>\n<h2 id=\"plotstackedbarplotinmatplotlib\"><span class=\"ez-toc-section\" id=\"plot_stacked_bar_plot_%d8%af%d8%b1_matplotlib\"><\/span>Plot Stacked Bar Plot \u062f\u0631 Matplotlib<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u062f\u0631 \u0646\u0647\u0627\u06cc\u062a\u060c \u0628\u06cc\u0627\u06cc\u06cc\u062f \u06cc\u06a9 \u0637\u0631\u062d \u0646\u0648\u0627\u0631 \u067e\u0634\u062a\u0647 \u0627\u06cc \u0631\u0627 \u062a\u0631\u0633\u06cc\u0645 \u06a9\u0646\u06cc\u0645.  \u0646\u0645\u0648\u062f\u0627\u0631\u0647\u0627\u06cc \u0646\u0648\u0627\u0631 \u0627\u0646\u0628\u0627\u0634\u062a\u0647 \u0634\u062f\u0647 \u0648\u0627\u0642\u0639\u0627\u064b \u0645\u0641\u06cc\u062f \u0647\u0633\u062a\u0646\u062f \u0627\u06af\u0631 \u06af\u0631\u0648\u0647\u06cc \u0627\u0632 \u0645\u062a\u063a\u06cc\u0631\u0647\u0627 \u0631\u0627 \u062f\u0627\u0634\u062a\u0647 \u0628\u0627\u0634\u06cc\u062f\u060c \u0627\u0645\u0627 \u0628\u0647 \u062c\u0627\u06cc \u062a\u0631\u0633\u06cc\u0645 \u0622\u0646\u0647\u0627 \u062f\u0631 \u06a9\u0646\u0627\u0631 \u06cc\u06a9\u062f\u06cc\u06af\u0631\u060c \u0645\u06cc \u062e\u0648\u0627\u0647\u06cc\u062f \u0622\u0646\u0647\u0627 \u0631\u0627 \u06cc\u06a9\u06cc \u062a\u0631\u0633\u06cc\u0645 \u06a9\u0646\u06cc\u062f. \u0631\u0648\u06cc \u0628\u0627\u0644\u0627\u06cc \u062f\u06cc\u06af\u0631\u06cc<\/p>\n<p>\u0628\u0631\u0627\u06cc \u0627\u06cc\u0646 \u06a9\u0627\u0631\u060c \u062f\u0648\u0628\u0627\u0631\u0647 \u06af\u0631\u0648\u0647 \u0647\u0627\u06cc\u06cc \u0627\u0632 \u062f\u0627\u062f\u0647 \u0647\u0627 \u0631\u0627 \u062e\u0648\u0627\u0647\u06cc\u0645 \u062f\u0627\u0634\u062a.  \u0633\u067e\u0633\u060c \u0627\u0646\u062d\u0631\u0627\u0641 \u0645\u0639\u06cc\u0627\u0631 \u0622\u0646\u0647\u0627 \u0631\u0627 \u0628\u0631\u0627\u06cc \u0646\u0648\u0627\u0631\u0647\u0627\u06cc \u062e\u0637\u0627 \u0645\u062d\u0627\u0633\u0628\u0647 \u0645\u06cc \u06a9\u0646\u06cc\u0645.<\/p>\n<p>\u062f\u0631 \u0646\u0647\u0627\u06cc\u062a\u060c \u0628\u0631\u0627\u06cc \u0631\u0633\u0645 \u0627\u06cc\u0646 \u0645\u062a\u063a\u06cc\u0631\u0647\u0627 \u0628\u0647 \u06cc\u06a9 \u0645\u062d\u062f\u0648\u062f\u0647 \u0634\u0627\u062e\u0635 \u0646\u06cc\u0627\u0632 \u062f\u0627\u0631\u06cc\u0645 \u0631\u0648\u06cc \u0628\u0631 \u0631\u0648\u06cc \u06cc\u06a9\u062f\u06cc\u06af\u0631\u060c \u062f\u0631 \u062d\u0627\u0644\u06cc \u06a9\u0647 \u0646\u0638\u0645 \u0646\u0633\u0628\u06cc \u062e\u0648\u062f \u0631\u0627 \u062d\u0641\u0638 \u0645\u06cc \u06a9\u0646\u0646\u062f.  \u0627\u06cc\u0646 \u0634\u0627\u062e\u0635 \u0627\u0633\u0627\u0633\u0627\u064b \u0637\u06cc\u0641\u06cc \u0627\u0632 \u0627\u0639\u062f\u0627\u062f \u0628\u0647 \u0637\u0648\u0644 \u062a\u0645\u0627\u0645 \u06af\u0631\u0648\u0647\u200c\u0647\u0627\u06cc\u06cc \u0627\u0633\u062a \u06a9\u0647 \u0645\u0627 \u062f\u0627\u0631\u06cc\u0645.<\/p>\n<p>\u0628\u0631\u0627\u06cc \u0686\u06cc\u062f\u0646 \u06cc\u06a9 \u0646\u0648\u0627\u0631 \u0631\u0648\u06cc \u06cc\u06a9\u06cc \u062f\u06cc\u06af\u0631\u060c \u0634\u0645\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u062f <code>bottom<\/code> \u0628\u062d\u062b \u0648 \u062c\u062f\u0644.  \u0634\u0645\u0627 \u0645\u0634\u062e\u0635 \u06a9\u0646\u06cc\u062f \u0686\u06cc\u0633\u062a \u0631\u0648\u06cc \u0631\u0627 <code>bottom<\/code> \u0627\u0632 \u0622\u0646 \u0646\u0648\u0627\u0631  \u0646\u0642\u0634\u0647 \u06a9\u0634\u06cc\u062f\u0646 <code>x<\/code> \u062f\u0631 \u0632\u06cc\u0631 <code>y<\/code>\u060c \u0634\u0645\u0627 \u062a\u0646\u0638\u06cc\u0645 \u0645\u06cc \u06a9\u0646\u06cc\u062f <code>x<\/code> \u0628\u0647 \u0639\u0646\u0648\u0627\u0646 <code>bottom<\/code> \u0627\u0632 <code>y<\/code>.<\/p>\n<p>\u0628\u0631\u0627\u06cc \u0628\u06cc\u0634 \u0627\u0632 \u06cc\u06a9 \u06af\u0631\u0648\u0647\u060c \u0628\u0627\u06cc\u062f \u0645\u0642\u0627\u062f\u06cc\u0631 \u0631\u0627 \u0642\u0628\u0644 \u0627\u0632 \u062a\u0631\u0633\u06cc\u0645 \u0628\u0627 \u0647\u0645 \u0627\u0636\u0627\u0641\u0647 \u06a9\u0646\u06cc\u062f\u060c \u062f\u0631 \u063a\u06cc\u0631 \u0627\u06cc\u0646 \u0635\u0648\u0631\u062a\u060c \u0646\u0645\u0648\u062f\u0627\u0631 \u0646\u0648\u0627\u0631 \u062c\u0645\u0639 \u0646\u0645\u06cc \u0634\u0648\u062f.  \u0645\u0627 \u0627\u0632 NumPy \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u062e\u0648\u0627\u0647\u06cc\u0645 \u06a9\u0631\u062f <code>np.add().tolist()<\/code> \u0628\u0631\u0627\u06cc \u0627\u0636\u0627\u0641\u0647 \u06a9\u0631\u062f\u0646 \u0639\u0646\u0627\u0635\u0631 \u062f\u0648 \u0644\u06cc\u0633\u062a \u0648 \u0627\u06cc\u062c\u0627\u062f \u06cc\u06a9 \u0644\u06cc\u0633\u062a \u0645\u062c\u062f\u062f:<\/p>\n<pre><code class=\"hljs\"><span class=\"hljs-keyword\">import<\/span> matplotlib.pyplot <span class=\"hljs-keyword\">as<\/span> plt\n<span class=\"hljs-keyword\">import<\/span> numpy <span class=\"hljs-keyword\">as<\/span> np\n\n\n\nx = (<span class=\"hljs-number\">1<\/span>, <span class=\"hljs-number\">3<\/span>, <span class=\"hljs-number\">2<\/span>)\ny = (<span class=\"hljs-number\">2<\/span>, <span class=\"hljs-number\">3<\/span>, <span class=\"hljs-number\">3<\/span>)\nz = (<span class=\"hljs-number\">7<\/span>, <span class=\"hljs-number\">6<\/span>, <span class=\"hljs-number\">8<\/span>)\n\n\nx_deviation = np.std(x)\ny_deviation = np.std(y)\nz_deviation = np.std(z)\n\nbars = (x, y, z)\nind = np.arange(<span class=\"hljs-built_in\">len<\/span>(bars))\nbar_categories = (<span class=\"hljs-string\">'X'<\/span>, <span class=\"hljs-string\">'Y'<\/span>, <span class=\"hljs-string\">'Z'<\/span>);\nbar_width = <span class=\"hljs-number\">0.5<\/span>\nbar_padding = np.add(x, y).tolist()\n\nplt.bar(ind, x, yerr=x_deviation, width=bar_width)\nplt.bar(ind, y, yerr=y_deviation, bottom=x, width=bar_width)\nplt.bar(ind, z, yerr=z_deviation, bottom=bar_padding, width=bar_width)\n\nplt.xticks(ind, bar_categories)\nplt.xlabel(<span class=\"hljs-string\">\"Stacked Bar Plot\"<\/span>)\n\nplt.show()\n<\/code><\/pre>\n<p>\u0627\u062c\u0631\u0627\u06cc \u0627\u06cc\u0646 \u06a9\u062f \u0646\u062a\u06cc\u062c\u0647 \u0645\u06cc \u062f\u0647\u062f:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/rasanegar.com\/blog\/wp-content\/uploads\/2024\/01\/matplotlib-bar-plot-tutorial-and-examples-6.png\" alt=\"\u0646\u0645\u0648\u062f\u0627\u0631 \u0646\u0648\u0627\u0631 \u0627\u0646\u0628\u0627\u0634\u062a\u0647 \u062f\u0631 matplotlib\" title=\"\"><\/p>\n<h2 id=\"conclusion\"><span class=\"ez-toc-section\" id=\"%d9%86%d8%aa%db%8c%d8%ac%d9%87\"><\/span>\u0646\u062a\u06cc\u062c\u0647<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u062f\u0631 \u0627\u06cc\u0646 \u0622\u0645\u0648\u0632\u0634\u060c \u0631\u0648\u0634\u200c\u0647\u0627\u06cc \u0645\u062e\u062a\u0644\u0641\u06cc \u0631\u0627 \u0628\u0631\u0627\u06cc \u062a\u0631\u0633\u06cc\u0645 \u0646\u0645\u0648\u062f\u0627\u0631 \u0646\u0648\u0627\u0631\u06cc \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 Matplotlib \u0648 Python \u0628\u0631\u0631\u0633\u06cc \u06a9\u0631\u062f\u0647\u200c\u0627\u06cc\u0645.  \u0645\u0627 \u0647\u0645\u0686\u0646\u06cc\u0646 \u0631\u0648\u0634 \u0645\u062d\u0627\u0633\u0628\u0647 \u0648 \u0627\u0636\u0627\u0641\u0647 \u06a9\u0631\u062f\u0646 \u0646\u0648\u0627\u0631\u0647\u0627\u06cc \u062e\u0637\u0627 \u0648 \u0647\u0645\u0686\u0646\u06cc\u0646 \u0646\u0648\u0627\u0631\u0647\u0627\u06cc \u067e\u0634\u062a\u0647 \u0631\u0627 \u067e\u0648\u0634\u0634 \u062f\u0627\u062f\u0647 \u0627\u06cc\u0645 \u0631\u0648\u06cc \u0631\u0648\u06cc \u0647\u0645<\/p>\n<p>\u0627\u06af\u0631 \u0628\u0647 \u062a\u062c\u0633\u0645 \u062f\u0627\u062f\u0647\u200c\u0647\u0627 \u0639\u0644\u0627\u0642\u0647 \u062f\u0627\u0631\u06cc\u062f \u0648 \u0646\u0645\u06cc\u200c\u062f\u0627\u0646\u06cc\u062f \u0627\u0632 \u06a9\u062c\u0627 \u0634\u0631\u0648\u0639 \u06a9\u0646\u06cc\u062f\u060c \u062d\u062a\u0645\u0627\u064b \u0645\u0627 \u0631\u0627 \u0628\u0631\u0631\u0633\u06cc \u06a9\u0646\u06cc\u062f <em>\u0628\u0633\u062a\u0647 \u06a9\u062a\u0627\u0628<\/em> \u0631\u0648\u06cc <a class=\"ebook-link\" href=\"https:\/\/gum.co\/data-visualization-in-python-book-bundle\" target=\"_blank\" rel=\"noopener\"><em>\u062a\u062c\u0633\u0645 \u062f\u0627\u062f\u0647 \u0647\u0627 \u062f\u0631 \u067e\u0627\u06cc\u062a\u0648\u0646<\/em><\/a>:<\/p>\n<p><em><strong>\u062a\u062c\u0633\u0645 \u062f\u0627\u062f\u0647 \u0647\u0627 \u062f\u0631 \u067e\u0627\u06cc\u062a\u0648\u0646 \u0628\u0627 Matplotlib \u0648 Pandas<\/strong><\/em>  \u06a9\u062a\u0627\u0628\u06cc \u0627\u0633\u062a \u06a9\u0647 \u0637\u0631\u0627\u062d\u06cc \u0634\u062f\u0647 \u0627\u0633\u062a \u062a\u0627 \u0645\u0628\u062a\u062f\u06cc\u0627\u0646 \u0645\u0637\u0644\u0642 \u0631\u0627 \u0628\u0627 \u062f\u0627\u0646\u0634 \u067e\u0627\u06cc\u0647 \u067e\u0627\u06cc\u062a\u0648\u0646 \u0628\u0647 Pandas \u0648 Matplotlib \u0628\u0628\u0631\u062f \u0648 \u0628\u0647 \u0622\u0646\u0647\u0627 \u0627\u062c\u0627\u0632\u0647 \u062f\u0647\u062f \u067e\u0627\u06cc\u0647 \u0627\u06cc \u0642\u0648\u06cc \u0628\u0631\u0627\u06cc \u06a9\u0627\u0631 \u067e\u06cc\u0634\u0631\u0641\u062a\u0647 \u0628\u0627 \u0627\u06cc\u0646 \u06a9\u062a\u0627\u0628\u062e\u0627\u0646\u0647 \u0647\u0627 \u0628\u0633\u0627\u0632\u0646\u062f &#8211; \u0627\u0632 \u0637\u0631\u062d \u0647\u0627\u06cc \u0633\u0627\u062f\u0647 \u06af\u0631\u0641\u062a\u0647 \u062a\u0627 \u0637\u0631\u062d \u0647\u0627\u06cc \u0633\u0647 \u0628\u0639\u062f\u06cc \u0645\u062a\u062d\u0631\u06a9 \u0628\u0627 \u062f\u06a9\u0645\u0647 \u0647\u0627\u06cc \u062a\u0639\u0627\u0645\u0644\u06cc.<\/p>\n<blockquote>\n<p>\u0627\u06cc\u0646 \u0628\u0647 \u0639\u0646\u0648\u0627\u0646 \u06cc\u06a9 \u0631\u0627\u0647\u0646\u0645\u0627\u06cc \u0639\u0645\u06cc\u0642 \u0639\u0645\u0644 \u0645\u06cc \u06a9\u0646\u062f \u06a9\u0647 \u0647\u0645\u0647 \u0686\u06cc\u0632\u0647\u0627\u06cc\u06cc \u0631\u0627 \u06a9\u0647 \u0628\u0627\u06cc\u062f \u062f\u0631 \u0645\u0648\u0631\u062f \u067e\u0627\u0646\u062f\u0627\u0647\u0627 \u0648 Matplotlib \u0628\u062f\u0627\u0646\u06cc\u062f\u060c \u0627\u0632 \u062c\u0645\u0644\u0647 \u0631\u0648\u0634 \u0633\u0627\u062e\u062a \u0627\u0646\u0648\u0627\u0639 \u0637\u0631\u062d \u0647\u0627\u06cc\u06cc \u06a9\u0647 \u062f\u0631 \u062e\u0648\u062f \u06a9\u062a\u0627\u0628\u062e\u0627\u0646\u0647 \u062a\u0639\u0628\u06cc\u0647 \u0646\u0634\u062f\u0647 \u0627\u0646\u062f \u0631\u0627 \u0628\u0647 \u0634\u0645\u0627 \u0622\u0645\u0648\u0632\u0634 \u0645\u06cc \u062f\u0647\u062f.<\/p>\n<\/blockquote>\n<p><em><strong>\u062a\u062c\u0633\u0645 \u062f\u0627\u062f\u0647 \u0647\u0627 \u062f\u0631 \u067e\u0627\u06cc\u062a\u0648\u0646<\/strong><\/em>\u060c \u06a9\u062a\u0627\u0628\u06cc \u0628\u0631\u0627\u06cc \u062a\u0648\u0633\u0639\u0647 \u062f\u0647\u0646\u062f\u06af\u0627\u0646 \u067e\u0627\u06cc\u062a\u0648\u0646 \u0645\u0628\u062a\u062f\u06cc \u062a\u0627 \u0645\u062a\u0648\u0633\u0637\u060c \u0634\u0645\u0627 \u0631\u0627 \u062f\u0631 \u062f\u0633\u062a\u06a9\u0627\u0631\u06cc \u0633\u0627\u062f\u0647 \u062f\u0627\u062f\u0647 \u0647\u0627 \u0628\u0627 \u067e\u0627\u0646\u062f\u0627\u0647\u0627 \u0631\u0627\u0647\u0646\u0645\u0627\u06cc\u06cc \u0645\u06cc \u06a9\u0646\u062f\u060c \u06a9\u062a\u0627\u0628\u062e\u0627\u0646\u0647 \u0647\u0627\u06cc \u062a\u0631\u0633\u06cc\u0645 \u0647\u0633\u062a\u0647 \u0627\u06cc \u0645\u0627\u0646\u0646\u062f Matplotlib \u0648 Seaborn \u0631\u0627 \u067e\u0648\u0634\u0634 \u0645\u06cc \u062f\u0647\u062f \u0648 \u0628\u0647 \u0634\u0645\u0627 \u0646\u0634\u0627\u0646 \u0645\u06cc \u062f\u0647\u062f \u06a9\u0647 \u0686\u06af\u0648\u0646\u0647 \u0627\u0632 \u06a9\u062a\u0627\u0628\u062e\u0627\u0646\u0647 \u0647\u0627\u06cc \u0627\u0639\u0644\u0627\u0645\u06cc \u0648 \u062a\u062c\u0631\u0628\u06cc \u0645\u0627\u0646\u0646\u062f Altair \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u062f.  \u0628\u0647 \u0637\u0648\u0631 \u062e\u0627\u0635\u060c \u062f\u0631 \u0637\u0648\u0644 \u06f1\u06f1 \u0641\u0635\u0644\u060c \u0627\u06cc\u0646 \u06a9\u062a\u0627\u0628 \u06f9 \u06a9\u062a\u0627\u0628\u062e\u0627\u0646\u0647 \u067e\u0627\u06cc\u062a\u0648\u0646 \u0631\u0627 \u067e\u0648\u0634\u0634 \u0645\u06cc\u200c\u062f\u0647\u062f: Pandas\u060c Matplotlib\u060c Seaborn\u060c Bokeh\u060c Altair\u060c Plotly\u060c GGPlot\u060c GeoPandas \u0648 VisPy.<\/p>\n<blockquote>\n<p>\u0627\u06cc\u0646 \u0628\u0647 \u0639\u0646\u0648\u0627\u0646 \u06cc\u06a9 \u0631\u0627\u0647\u0646\u0645\u0627\u06cc \u0639\u0645\u0644\u06cc \u0648 \u0645\u0646\u062d\u0635\u0631 \u0628\u0647 \u0641\u0631\u062f \u0628\u0631\u0627\u06cc \u062a\u062c\u0633\u0645 \u062f\u0627\u062f\u0647 \u0647\u0627\u060c \u062f\u0631 \u0645\u062c\u0645\u0648\u0639\u0647 \u0627\u06cc \u0627\u0632 \u0627\u0628\u0632\u0627\u0631\u0647\u0627\u06cc\u06cc \u06a9\u0647 \u0645\u0645\u06a9\u0646 \u0627\u0633\u062a \u062f\u0631 \u062d\u0631\u0641\u0647 \u062e\u0648\u062f \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u062f\u060c \u0639\u0645\u0644 \u0645\u06cc \u06a9\u0646\u062f.<\/p>\n<\/blockquote>\n<\/div>\n<p><script>\n                        !function(f,b,e,v,n,t,s)\n                        {if(f.fbq)return;n=f.fbq=function(){n.callMethod?\n                        n.callMethod.apply(n,arguments):n.queue.push(arguments)};\n                        if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';\n                        n.queue=();t=b.createElement(e);t.async=!0;\n                        t.src=v;s=b.getElementsByTagName(e)(0);\n                        s.parentNode.insertBefore(t,s)}(window, document,'script',\n                        'https:\/\/connect.facebook.net\/en_US\/fbevents.js');\n                        fbq('init', '525232124909042');\n                        fbq('track', 'PageView');\n                    <\/script>    (\u0628\u0631\u0686\u0633\u0628\u200c\u0647\u0627 \u0628\u0647 \u062a\u0631\u062c\u0645\u0647)# python<br \/>\n<br \/><br \/>\n<br \/>\u0645\u0646\u062a\u0634\u0631 \u0634\u062f\u0647 \u062f\u0631 1403-01-14 07:51:03<br \/>\n<\/p>\n\n\n<div class=\"kk-star-ratings kksr-auto kksr-align-center kksr-valign-bottom\"\n    data-payload='{&quot;align&quot;:&quot;center&quot;,&quot;id&quot;:&quot;15584&quot;,&quot;slug&quot;:&quot;default&quot;,&quot;valign&quot;:&quot;bottom&quot;,&quot;ignore&quot;:&quot;&quot;,&quot;reference&quot;:&quot;auto&quot;,&quot;class&quot;:&quot;&quot;,&quot;count&quot;:&quot;0&quot;,&quot;legendonly&quot;:&quot;&quot;,&quot;readonly&quot;:&quot;&quot;,&quot;score&quot;:&quot;0&quot;,&quot;starsonly&quot;:&quot;&quot;,&quot;best&quot;:&quot;5&quot;,&quot;gap&quot;:&quot;5&quot;,&quot;greet&quot;:&quot;\u0627\u0645\u062a\u06cc\u0627\u0632 \u0634\u0645\u0627 \u0628\u0647 \u0627\u06cc\u0646 \u0645\u0637\u0644\u0628&quot;,&quot;legend&quot;:&quot;0\\\/5 (0 \u0631\u0627\u06cc)&quot;,&quot;size&quot;:&quot;30&quot;,&quot;title&quot;:&quot;Matplotlib Bar Plot - \u0622\u0645\u0648\u0632\u0634 \u0648 \u0645\u062b\u0627\u0644&quot;,&quot;width&quot;:&quot;0&quot;,&quot;_legend&quot;:&quot;{score}\\\/{best} ({count} \u0631\u0627\u06cc)&quot;,&quot;font_factor&quot;:&quot;1.25&quot;}'>\n            \n<div class=\"kksr-stars\">\n    \n<div class=\"kksr-stars-inactive\">\n            <div class=\"kksr-star\" data-star=\"1\" style=\"padding-left: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 30px; height: 30px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"2\" style=\"padding-left: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 30px; height: 30px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"3\" style=\"padding-left: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 30px; height: 30px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"4\" style=\"padding-left: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 30px; height: 30px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"5\" style=\"padding-left: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 30px; height: 30px;\"><\/div>\n        <\/div>\n    <\/div>\n    \n<div class=\"kksr-stars-active\" style=\"width: 0px;\">\n            <div class=\"kksr-star\" style=\"padding-left: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 30px; height: 30px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-left: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 30px; height: 30px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-left: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 30px; height: 30px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-left: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 30px; height: 30px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-left: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 30px; height: 30px;\"><\/div>\n        <\/div>\n    <\/div>\n<\/div>\n                \n\n<div class=\"kksr-legend\" style=\"font-size: 24px;\">\n            <span class=\"kksr-muted\">\u0627\u0645\u062a\u06cc\u0627\u0632 \u0634\u0645\u0627 \u0628\u0647 \u0627\u06cc\u0646 \u0645\u0637\u0644\u0628<\/span>\n    <\/div>\n    <\/div>\n","protected":false},"excerpt":{"rendered":"<p><span class=\"span-reading-time rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\">\u0632\u0645\u0627\u0646 \u0644\u0627\u0632\u0645 \u0628\u0631\u0627\u06cc \u0645\u0637\u0627\u0644\u0639\u0647: <\/span> <span class=\"rt-time\"> 5<\/span> <span class=\"rt-label rt-postfix\">\u062f\u0642\u06cc\u0642\u0647<\/span><\/span>\u0645\u0639\u0631\u0641\u06cc Matplotlib \u06cc\u06a9\u06cc \u0627\u0632 \u067e\u0631\u06a9\u0627\u0631\u0628\u0631\u062f\u062a\u0631\u06cc\u0646 \u06a9\u062a\u0627\u0628\u062e\u0627\u0646\u0647 \u0647\u0627\u06cc \u062a\u062c\u0633\u0645 \u062f\u0627\u062f\u0647 \u062f\u0631 \u067e\u0627\u06cc\u062a\u0648\u0646 \u0627\u0633\u062a. \u0627\u0632 \u062a\u062c\u0633\u0645 \u0647\u0627\u06cc \u0633\u0627\u062f\u0647 \u06af\u0631\u0641\u062a\u0647 \u062a\u0627 \u067e\u06cc\u0686\u06cc\u062f\u0647\u060c \u0627\u06cc\u0646 \u06a9\u062a\u0627\u0628\u062e\u0627\u0646\u0647 \u0628\u0631\u0627\u06cc \u0628\u06cc\u0634\u062a\u0631 \u0627\u0641\u0631\u0627\u062f \u0627\u0633\u062a. \u062f\u0631 \u0627\u06cc\u0646 \u0622\u0645\u0648\u0632\u0634\u060c \u0631\u0648\u0634 \u0627\u0646\u062c\u0627\u0645 \u0627\u06cc\u0646 \u06a9\u0627\u0631 \u0631\u0627 \u0628\u0631\u0631\u0633\u06cc \u062e\u0648\u0627\u0647\u06cc\u0645 \u06a9\u0631\u062f \u0637\u0631\u062d \u06cc\u06a9 \u0637\u0631\u062d \u0646\u0648\u0627\u0631 \u062f\u0631 Matplotlib. \u0646\u0645\u0648\u062f\u0627\u0631\u0647\u0627\u06cc \u0645\u06cc\u0644\u0647 \u0627\u06cc \u0645\u0642\u0627\u062f\u06cc\u0631 \u0639\u062f\u062f\u06cc \u0631\u0627 \u0646\u0645\u0627\u06cc\u0634 \u0645\u06cc \u062f\u0647\u0646\u062f \u0631\u0648\u06cc \u06cc\u06a9 \u0645\u062d\u0648\u0631 \u0648 [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":15585,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1743,620],"tags":[],"class_list":["post-15584","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","category-programming"],"acf":[],"_links":{"self":[{"href":"https:\/\/rasanegaar.com\/blog\/wp-json\/wp\/v2\/posts\/15584","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rasanegaar.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rasanegaar.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rasanegaar.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/rasanegaar.com\/blog\/wp-json\/wp\/v2\/comments?post=15584"}],"version-history":[{"count":0,"href":"https:\/\/rasanegaar.com\/blog\/wp-json\/wp\/v2\/posts\/15584\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/rasanegaar.com\/blog\/wp-json\/wp\/v2\/media\/15585"}],"wp:attachment":[{"href":"https:\/\/rasanegaar.com\/blog\/wp-json\/wp\/v2\/media?parent=15584"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rasanegaar.com\/blog\/wp-json\/wp\/v2\/categories?post=15584"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rasanegaar.com\/blog\/wp-json\/wp\/v2\/tags?post=15584"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}