{"id":412978,"date":"2024-06-29T22:51:36","date_gmt":"2024-06-29T22:51:36","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=412978"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2024-06-29T22:51:36","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=412978","title":{"rendered":"<span>\u0414\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0430 \u0432\u043e\u0440\u043e\u043d\u043a\u0438 \u0432 Python<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d4f\/01b\/1e8\/d4f01b1e858eb2ffbd74bcb5c2a8f7de.png\" width=\"780\" height=\"439\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d4f\/01b\/1e8\/d4f01b1e858eb2ffbd74bcb5c2a8f7de.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0414\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u044b \u0432\u043e\u0440\u043e\u043d\u043a\u0438 \u0437\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430. \u041e\u043d\u0438 \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0442 \u0441\u043c\u043e\u0442\u0440\u044f\u0449\u0435\u043c\u0443 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u0438 \u0432\u0438\u0434\u0435\u0442\u044c, \u043a\u0430\u043a \u0446\u0438\u0444\u0440\u044b \u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u043e\u0442 \u044d\u0442\u0430\u043f\u0430 \u043a \u044d\u0442\u0430\u043f\u0443.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0432\u043e\u0440\u043e\u043d\u043a\u0443 \u0441 \u043d\u0443\u043b\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Matplotlib, \u0430 \u0437\u0430\u0442\u0435\u043c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Plotly.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ef2\/e3a\/b52\/ef2e3ab52b478bfedc05769d17114217.png\" alt=\"\u0414\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0430 \u0432\u043e\u0440\u043e\u043d\u043a\u0438. \u0418\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0430\u0432\u0442\u043e\u0440\u0430 \" title=\"\u0414\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0430 \u0432\u043e\u0440\u043e\u043d\u043a\u0438. \u0418\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0430\u0432\u0442\u043e\u0440\u0430 \" width=\"929\" height=\"452\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ef2\/e3a\/b52\/ef2e3ab52b478bfedc05769d17114217.png\"\/><figcaption>\u0414\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0430 \u0432\u043e\u0440\u043e\u043d\u043a\u0438. \u0418\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0430\u0432\u0442\u043e\u0440\u0430 <\/figcaption><\/figure>\n<p><strong>Matplotlib<\/strong><\/p>\n<p>\u0412 Matplotlib \u043d\u0435\u0442 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0432\u043e\u0440\u043e\u043d\u043a\u0443, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u0445\u043e\u0434\u0438\u0442\u044c \u0438\u0437 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u0439 \u043b\u0438\u043d\u0435\u0439\u0447\u0430\u0442\u043e\u0439 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u044b, \u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u043c \u0432\u043e\u0440\u043e\u043d\u043a\u0443 \u0438\u0437 \u043d\u0435\u0435.<\/p>\n<pre><code class=\"python\">import matplotlib.pyplot as plt y = [5,4,3,2,1] x = [80,73,58,42,23] plt.barh(y, x)<\/code><\/pre>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/1cc\/bc1\/9b1\/1ccbc19b170b3c226928f6daa31452e5.png\" width=\"443\" height=\"315\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1cc\/bc1\/9b1\/1ccbc19b170b3c226928f6daa31452e5.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0431\u043b\u0438\u0437\u043a\u043e \u043a \u0442\u043e\u043c\u0443, \u0447\u0435\u0433\u043e \u043c\u044b \u0434\u043e\u0431\u0438\u0432\u0430\u0435\u043c\u0441\u044f, \u0442\u0430\u043a \u043f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u043d\u0435 \u043e\u0441\u0442\u0430\u0442\u044c\u0441\u044f \u0437\u0434\u0435\u0441\u044c \u0438 \u043d\u0435 \u043e\u0442\u0434\u0435\u043b\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0433\u0438\u0441\u0442\u043e\u0433\u0440\u0430\u043c\u043c\u043e\u0439?<\/p>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0440\u043e\u0441\u0442\u0435\u043d\u044c\u043a\u043e\u0439 \u0433\u0438\u0441\u0442\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0438 \u043b\u0435\u0433\u0447\u0435, \u043d\u043e \u0432\u044b\u0431\u043e\u0440 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u044b-\u0432\u043e\u0440\u043e\u043d\u043a\u0438 \u043c\u043e\u0436\u0435\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0437\u0430\u0438\u043c\u043e\u0441\u0432\u044f\u0437\u044c \u043c\u0435\u0436\u0434\u0443 \u0441\u0442\u043e\u043b\u0431\u0446\u0430\u043c\u0438 \u0431\u043e\u043b\u0435\u0435 \u044f\u0432\u043d\u043e\u0439 \u0438 \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u0442\u044c \u043d\u0430\u0448\u0443 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0432 \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u0438\u0432\u043b\u0435\u043a\u0430\u0442\u0435\u043b\u044c\u043d\u0443\u044e.<\/p>\n<p>\u0425\u043e\u0440\u043e\u0448\u043e, \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u0441\u0442\u043e\u043b\u0431\u0446\u0443 \u0437\u0430 \u0440\u0430\u0437 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u00ab<em>left<\/em>\u00bb, \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u0440\u0435\u0433\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0435. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u043a\u0430\u043a \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c.<\/p>\n<pre><code class=\"python\">y = [5,4,3,2,1] x = [80,73,58,42,23] x_max = 100 x_min = 0 for idx, val in enumerate(x):     plt.barh(y[idx], x[idx], left = idx+5) plt.xlim(x_min, x_max)<\/code><\/pre>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/627\/cec\/c7e\/627cecc7ea757d357ce983e7f4deb645.png\" width=\"466\" height=\"317\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/627\/cec\/c7e\/627cecc7ea757d357ce983e7f4deb645.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440 \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0430\u0432\u0435\u043d x, \u0438 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u043e\u0441\u0438 x, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0430\u0432\u0435\u043d 100.<\/p>\n<p>\u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u043c\u0435\u0436\u0434\u0443 \u044d\u0442\u0438\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u2013 \u044d\u0442\u043e \u043f\u0443\u0441\u0442\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e. \u0427\u0442\u043e\u0431\u044b \u043e\u0442\u0446\u0435\u043d\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u043e\u043b\u0431\u0446\u044b \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0443\u0441\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u0441 \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0437 \u0441\u0442\u043e\u0440\u043e\u043d.<\/p>\n<p>\u0418\u0442\u0430\u043a, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e:\u00a0<\/p>\n<p><em>left = (\u0440\u0430\u0437\u043c\u0435\u0440 \u0441\u0442\u043e\u043b\u0431\u0446\u0430 \u2013 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u043e\u0441\u0438 x) \/ 2<\/em><\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442:<\/p>\n<pre><code class=\"python\">y = [5,4,3,2,1] x = [80,73,58,42,23] x_max = 100 x_min = 0 for idx, val in enumerate(x):     left = (x_max - val)\/2     plt.barh(y[idx], x[idx], left = left, color='grey') plt.xlim(x_min, x_max)<\/code><\/pre>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/22a\/c37\/df5\/22ac37df5965090bd0690c9dd8f0e87f.png\" width=\"456\" height=\"306\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/22a\/c37\/df5\/22ac37df5965090bd0690c9dd8f0e87f.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041e\u0442\u043b\u0438\u0447\u043d\u043e! \u041e\u0434\u043d\u0430\u043a\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e\u0431 \u043e\u0441\u044f\u0445 \u043a\u0430\u043a\u0430\u044f-\u0442\u043e \u0431\u0435\u0441\u043f\u043e\u043b\u0435\u0437\u043d\u0430\u044f, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0443 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432 \u043d\u0435 \u043e\u0434\u043d\u0430 \u0438 \u0442\u0430 \u0436\u0435 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430. \u041d\u0443\u0436\u043d\u043e \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u044d\u0442\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043d\u0430 \u0441\u0442\u043e\u043b\u0431\u0446\u0430\u0445 \u0438 \u0441\u043e\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u0438\u0445.<\/p>\n<pre><code class=\"python\">y = [5,4,3,2,1] x = [80,73,58,42,23] x_max = 100 x_min = 0 fig, ax = plt.subplots(1, figsize=(12,6)) for idx, val in enumerate(x):     left = (x_max - val)\/2     plt.barh(y[idx], x[idx], left = left, color='grey', height=1, edgecolor='black')     # value     plt.text(50, y[idx], x[idx], ha='center', fontproperties=font,              fontsize=16, color='#2A2A2A') plt.axis('off') plt.xlim(x_min, x_max)<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/20c\/419\/bd7\/20c419bd7aa761430dc2a746c57fdc62.png\" width=\"720\" height=\"403\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/20c\/419\/bd7\/20c419bd7aa761430dc2a746c57fdc62.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0425\u043e\u0440\u043e\u0448\u043e, \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a, \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044f\u0440\u043b\u044b\u043a\u043e\u0432 \u043d\u0430 \u0441\u0442\u043e\u043b\u0431\u0446\u0430\u0445 \u0438 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u0442\u044c \u043d\u0430 \u044d\u0442\u043e\u043c.<\/p>\n<p>\u041d\u043e \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0443\u0441\u043b\u0430\u0434\u044b \u0434\u043b\u044f \u0433\u043b\u0430\u0437 \u0441\u043c\u043e\u0442\u0440\u044f\u0449\u0435\u0433\u043e \u0438 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0442\u0435\u043d\u044c, \u0441\u043e\u0435\u0434\u0438\u043d\u044f\u044e\u0449\u0443\u044e \u0441\u0442\u043e\u043b\u0431\u0446\u044b, \u0432\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043a\u043b\u0435\u0438\u0432\u0430\u0442\u044c \u0438\u0445 \u0432\u043c\u0435\u0441\u0442\u0435. \u0422\u0430\u043a \u0432\u0430\u0448\u0430 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0430 \u0441\u0442\u0430\u043d\u0435\u0442 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u0435\u0435 \u0438 \u0441\u0432\u044f\u0437\u044c \u043c\u0435\u0436\u0434\u0443 \u0441\u0442\u043e\u043b\u0431\u0446\u0430\u043c\u0438 \u0441\u0442\u0430\u043d\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u0442\u043a\u043e\u0439.<\/p>\n<p>\u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043d\u0430\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435:<\/p>\n<pre><code class=\"python\">from matplotlib import font_manager as fm # funnel chart y = [5,4,3,2,1] x = [80,73,58,42,23] labels = ['Hot Leads', 'Samples Sent', 'Quotes', 'Negotiations', 'Sales'] x_max = 100 x_min = 0 x_range = x_max - x_min fpath = \"fonts\/NotoSans-Regular.ttf\" font = fm.FontProperties(fname=fpath)<\/code><\/pre>\n<p>\u0418 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0434\u0435\u0442\u0430\u043b\u0435\u0439.<\/p>\n<pre><code class=\"python\">fig, ax = plt.subplots(1, figsize=(12,6)) for idx, val in enumerate(x):     left = (x_range - val)\/2     plt.barh(y[idx], x[idx], left = left, color='#808B96',              height=.8, edgecolor='black')     # label     plt.text(50, y[idx]+0.1, labels[idx], ha='center',               fontproperties=font, fontsize=16, color='#2A2A2A')     # value     plt.text(50, y[idx]-0.3, x[idx], ha='center',              fontproperties=font, fontsize=16, color='#2A2A2A')      plt.xlim(x_min, x_max) plt.axis('off') plt.title('Beskar Forging Services Inc.', fontproperties=font, loc='center', fontsize=24, color='#2A2A2A') plt.show()<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/388\/b72\/3ef\/388b723eff566aa00bc09e24357d9e47.png\" width=\"712\" height=\"448\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/388\/b72\/3ef\/388b723eff566aa00bc09e24357d9e47.png\"\/><figcaption><\/figcaption><\/figure>\n<p><em>*\u0428\u0440\u0438\u0444\u0442 \u0432\u0437\u044f\u0442 \u043e\u0442\u0441\u044e\u0434\u0430: <\/em><a href=\"https:\/\/fonts.google.com\/specimen\/Noto+Sans\"><em><u>https:\/\/fonts.google.com\/specimen\/Noto+Sans<\/u><\/em><\/a><\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0434\u0435\u043c \u043b\u0438\u043d\u0438\u044e \u043e\u0442 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u0441\u0442\u043e\u043b\u0431\u0446\u0430 \u043a \u0434\u0440\u0443\u0433\u043e\u0439. \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>left<\/em>, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0439\u0442\u0438 \u043d\u0430\u0447\u0430\u043b\u043e \u0438 \u043a\u043e\u043d\u0435\u0446 \u0441\u0442\u043e\u043b\u0431\u0446\u0430, \u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>y<\/em>, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0439\u0442\u0438 \u0435\u0433\u043e \u0446\u0435\u043d\u0442\u0440.<\/p>\n<pre><code class=\"python\">fig, ax = plt.subplots(1, figsize=(12,6)) for idx, val in enumerate(x):     left = (x_range - val)\/2     plt.barh(y[idx], x[idx], left = left, color='#808B96', height=.8, edgecolor='black')     # label     plt.text(50, y[idx]+0.1, labels[idx], ha='center',              fontproperties=font, fontsize=16, color='#2A2A2A')     # value     plt.text(50, y[idx]-0.3, x[idx], ha='center',              fontproperties=font, fontsize=16, color='#2A2A2A')          plt.plot([left, 100-left], [y[idx], y[idx]]) plt.xlim(x_min, x_max) plt.axis('off') plt.title('Beskar Forging Services Inc.', fontproperties=font, loc='center', fontsize=24, color='#2A2A2A') plt.show()<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/8b4\/a33\/87b\/8b4a3387b49b20dbb787a650442d3765.png\" width=\"688\" height=\"441\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8b4\/a33\/87b\/8b4a3387b49b20dbb787a650442d3765.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0434\u0432\u0438\u043d\u0435\u043c \u044d\u0442\u0443 \u043b\u0438\u043d\u0438\u044e \u0432 \u043d\u0438\u0436\u043d\u044e\u044e \u0447\u0430\u0441\u0442\u044c \u0441\u0442\u043e\u043b\u0431\u0446\u0430, \u0430 \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u2013 \u0435\u0435 \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u0432\u043e\u0432\u0441\u0435, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0442\u0430\u043c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u043d\u0435 \u0431\u0443\u0434\u0435\u0442.\u00a0<\/p>\n<p>\u0412\u044b\u0441\u043e\u0442\u0430 \u0441\u0442\u043e\u043b\u0431\u0446\u0430 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u043d\u0430 0.8, \u043f\u043e\u044d\u0442\u043e\u043c\u0443, \u0447\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043b\u0438\u043d\u0438\u044e \u0432\u043d\u0438\u0437, \u043d\u0443\u0436\u043d\u043e \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c <em>y<\/em> \u0434\u043e 0.4.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0432\u0435\u0440\u0448\u0438\u043d\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430.<\/p>\n<pre><code class=\"python\">fig, ax = plt.subplots(1, figsize=(12,6)) for idx, val in enumerate(x):     left = (x_range - val)\/2     plt.barh(y[idx], x[idx], left = left, color='#808B96', height=.8, edgecolor='black')     # label     plt.text(50, y[idx]+0.1, labels[idx], ha='center',              fontproperties=font, fontsize=16, color='#2A2A2A')     # value     plt.text(50, y[idx]-0.3, x[idx], ha='center',              fontproperties=font, fontsize=16, color='#2A2A2A')          if idx != len(x)-1:         next_left = (x_range - x[idx+1])\/2         plt.plot([left, 100-left],                   [y[idx]-0.4, y[idx]-0.4])         plt.plot([next_left, 100-next_left],                   [y[idx+1]+0.4, y[idx+1]+0.4]) plt.xlim(x_min, x_max) plt.axis('off') plt.title('Beskar Forging Services Inc.', fontproperties=font, loc='center', fontsize=24, color='#2A2A2A') plt.show()<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f03\/26e\/0bb\/f0326e0bb6e7bd9e460a2022944ff86d.png\" width=\"783\" height=\"457\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f03\/26e\/0bb\/f0326e0bb6e7bd9e460a2022944ff86d.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041c\u044b \u043d\u0430\u0448\u043b\u0438 \u0432\u0441\u0435 \u0442\u043e\u0447\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c. \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u044d\u0442\u0438 \u0442\u043e\u0447\u043a\u0438 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043b\u0438 \u043c\u044b \u043d\u0443\u0436\u043d\u0443\u044e \u0444\u043e\u0440\u043c\u0443.<\/p>\n<p>\u041d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u043f\u0440\u043e\u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0432\u0443\u044e \u0442\u043e\u0447\u043a\u0443 \u0432 \u0441\u0430\u043c\u043e\u043c \u043a\u043e\u043d\u0446\u0435, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u043c\u043a\u043d\u0443\u0442\u044c \u043c\u043d\u043e\u0433\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a.<\/p>\n<pre><code class=\"python\">fig, ax = plt.subplots(1, figsize=(12,6)) for idx, val in enumerate(x):     left = (x_range - val)\/2     plt.barh(y[idx], x[idx], left = left, color='#808B96', height=.8, edgecolor='black')     # label     plt.text(50, y[idx]+0.1, labels[idx], ha='center',              fontproperties=font, fontsize=16, color='#2A2A2A')     # value     plt.text(50, y[idx]-0.3, x[idx], ha='center',              fontproperties=font, fontsize=16, color='#2A2A2A')          if idx != len(x)-1:         next_left = (x_range - x[idx+1])\/2         shadow_x = [left, next_left,                      100-next_left, 100-left, left]                  shadow_y = [y[idx]-0.4, y[idx+1]+0.4,                      y[idx+1]+0.4, y[idx]-0.4, y[idx]-0.4]         plt.plot(shadow_x, shadow_y) plt.xlim(x_min, x_max) plt.axis('off') plt.title('Beskar Forging Services Inc.', fontproperties=font, loc='center', fontsize=24, color='#2A2A2A') plt.show()<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/dec\/547\/a67\/dec547a6798106c7d20ce070ba3daef9.png\" width=\"720\" height=\"444\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/dec\/547\/a67\/dec547a6798106c7d20ce070ba3daef9.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0418\u0434\u0435\u0430\u043b\u044c\u043d\u043e. \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c <code>.plot<\/code> \u043d\u0430 <code>.fill<\/code> \u0438 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0430 \u0433\u043e\u0442\u043e\u0432\u0430.<\/p>\n<pre><code class=\"python\">fig, ax = plt.subplots(1, figsize=(12,6)) for idx, val in enumerate(x):     left = (x_range - val)\/2     plt.barh(y[idx], x[idx], left = left,               color='#808B96', height=.8)     # label     plt.text(50, y[idx]+0.1, labels[idx], ha='center',              fontproperties=font, fontsize=16, color='#2A2A2A')     # value     plt.text(50, y[idx]-0.3, x[idx], ha='center',              fontproperties=font, fontsize=16, color='#2A2A2A')          if idx != len(x)-1:         next_left = (x_range - x[idx+1])\/2         shadow_x = [left, next_left,                      100-next_left, 100-left, left]                  shadow_y = [y[idx]-0.4, y[idx+1]+0.4,                      y[idx+1]+0.4, y[idx]-0.4, y[idx]-0.4]         plt.fill(shadow_x, shadow_y, color='grey', alpha=0.6) plt.xlim(x_min, x_max) plt.axis('off') plt.title('Beskar Forging Services Inc.', fontproperties=font, loc='center', fontsize=24, color='#2A2A2A') plt.show()<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/869\/95d\/68a\/86995d68a7281a52fd8a757c02a54122.png\" width=\"701\" height=\"438\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/869\/95d\/68a\/86995d68a7281a52fd8a757c02a54122.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412\u043e\u0442 \u0438 \u043e\u043d\u043e!<\/p>\n<p>\u0420\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u043e\u0440\u043e\u043d\u043a\u0438 \u0441 Matplotlib \u043c\u043e\u0436\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u0435\u0440\u0435\u0440\u0430\u0441\u0442\u0438 \u0438\u0437 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u0432 \u0441\u043b\u043e\u0436\u043d\u0443\u044e.\u00a0<\/p>\n<p>\u041d\u043e \u0432 \u044d\u0442\u043e\u043c \u0438 \u0435\u0441\u0442\u044c \u043e\u0441\u043e\u0431\u0430\u044f \u043f\u0440\u0435\u043b\u0435\u0441\u0442\u044c Matplotlib, \u0432\u0435\u0434\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043d\u0430\u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0441\u0435, \u0447\u0442\u043e \u0434\u0443\u0448\u0435 \u0443\u0433\u043e\u0434\u043d\u043e.<\/p>\n<p><strong>Plotly<\/strong><\/p>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u043c\u0443 \u0441\u043f\u043e\u0441\u043e\u0431\u0443 \u0434\u043e\u0441\u0442\u0438\u0447\u044c \u0442\u0435\u0445 \u0436\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432, \u0438 \u043d\u0430\u0440\u0438\u0441\u0443\u0435\u043c \u0432\u043e\u0440\u043e\u043d\u043a\u0443 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Plotly.<\/p>\n<pre><code class=\"python\">import plotly.express as px data = dict(values=[80,73,58,42,23],             labels=['Hot Leads', 'Samples Sent',                      'Quotes', 'Negotiations', 'Sales']) fig = px.funnel(data, y='labels', x='values') fig.show()<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/695\/3e2\/929\/6953e2929ebb2ce1b2f70c1e3310ed73.png\" width=\"850\" height=\"413\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/695\/3e2\/929\/6953e2929ebb2ce1b2f70c1e3310ed73.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041f\u043e\u0442\u0440\u044f\u0441\u0430\u044e\u0449\u0435. \u0423 Plotly \u0435\u0441\u0442\u044c \u043c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c-\u0432\u043e\u0440\u043e\u043d\u043e\u043a, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u044b \u043b\u0438\u0448\u044c \u0434\u0430\u043d\u043d\u044b\u0435, \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u0434\u0435\u043b\u0430\u044e\u0442 \u0437\u0430 \u043d\u0430\u0441.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0443 Plotly \u0435\u0441\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043e\u043f\u0446\u0438\u0439 \u0434\u043b\u044f \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c.<\/p>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0437\u0434\u0435\u0441\u044c \u0432\u044b \u043d\u0435 \u0442\u0430\u043a \u0445\u043e\u0440\u043e\u0448\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u0442\u0435 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e, \u043a\u0430\u043a \u0434\u043e \u044d\u0442\u043e\u0433\u043e, \u043d\u043e \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0432\u043e\u0440\u043e\u043d\u043a\u0443 \u0442\u0430\u043a \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0443\u0434\u043e\u0431\u043d\u0435\u0435.<\/p>\n<pre><code class=\"python\">data = dict(Quantity=[80, 73, 58, 42, 23,                       180, 120, 82, 51, 33,                       109, 78, 62, 44, 22],                  Stage=['Hot Leads', 'Samples Sent', 'Quotes',                    'Negotiations', 'Sales']*3,                  Location=['Tatooine']*5 + ['Mandalore']*5 + ['Nevarro']*5)      fig = px.funnel(data, y='Stage', x='Quantity', color='Location',                 color_discrete_map={\"Tatooine\": \"#374B53\",                                      \"Mandalore\": \"#617588\",                                     \"Nevarro\": \"#A4B7C8\"},                 template=\"simple_white\",                 title='Beskar Forging Services Inc.',                 labels={\"Stage\": \"\"}) fig.show() <\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/945\/405\/755\/945405755659e047fa89620641da7701.png\" width=\"875\" height=\"418\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/945\/405\/755\/945405755659e047fa89620641da7701.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0418 \u0432\u0441\u0435! \u041c\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438, \u043a\u0430\u043a \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0432\u043e\u0440\u043e\u043d\u043a\u0443 \u0441 \u043d\u0443\u043b\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Matplotlib, \u0438 \u0443\u0432\u0438\u0434\u0435\u043b\u0438 \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u043b\u043e\u0436\u043d\u0438\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e. \u0410 \u0435\u0449\u0435 \u043c\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b\u0438 \u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u044b-\u0432\u043e\u0440\u043e\u043d\u043a\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Plotly \u0438 \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u043b\u0438\u0441\u044c \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0432\u0430\u0440\u0438\u0430\u0446\u0438\u044f\u043c\u0438 \u0435\u0435 \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0430\u0446\u0438\u0438.<\/p>\n<p>\u0421\u043f\u0430\u0441\u0438\u0431\u043e, \u0447\u0442\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043b\u0438. \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0432\u0430\u043c \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u043b\u043e\u0441\u044c.<\/p>\n<hr\/>\n<blockquote>\n<p>\u041c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043a\u0443\u0440\u0441\u0430 <a href=\"https:\/\/otus.pw\/G8z8\/\">\u00abPython \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0438\u00bb. <\/a><\/p>\n<p>\u0412\u0441\u0435\u0445 \u0436\u0435\u043b\u0430\u044e\u0449\u0438\u0445 \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0430\u0435\u043c \u043d\u0430 demo-\u0437\u0430\u043d\u044f\u0442\u0438\u0435 <strong>\u00ab\u041f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 Python \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u00bb<\/strong>. \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043e\u0442\u0447\u0435\u0442, \u0438\u043d\u043e\u0433\u0434\u0430 \u0442\u0440\u0435\u0431\u0443\u044e\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432. \u041d\u0430 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u043c \u0443\u0440\u043e\u043a\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0432\u0438\u0434\u043e\u0432 \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432 \u043d\u0430 python \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a. <br \/><a href=\"https:\/\/otus.pw\/ZLWa\/\">>> \u0420\u0415\u0413\u0418\u0421\u0422\u0420\u0410\u0426\u0418\u042f<\/a><\/p>\n<\/blockquote>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/589593\/\"> https:\/\/habr.com\/ru\/articles\/589593\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0414\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u044b \u0432\u043e\u0440\u043e\u043d\u043a\u0438 \u0437\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430. \u041e\u043d\u0438 \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0442 \u0441\u043c\u043e\u0442\u0440\u044f\u0449\u0435\u043c\u0443 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u0438 \u0432\u0438\u0434\u0435\u0442\u044c, \u043a\u0430\u043a \u0446\u0438\u0444\u0440\u044b \u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u043e\u0442 \u044d\u0442\u0430\u043f\u0430 \u043a \u044d\u0442\u0430\u043f\u0443.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0432\u043e\u0440\u043e\u043d\u043a\u0443 \u0441 \u043d\u0443\u043b\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Matplotlib, \u0430 \u0437\u0430\u0442\u0435\u043c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Plotly.<\/p>\n<figure class=\"full-width\"><figcaption>\u0414\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0430 \u0432\u043e\u0440\u043e\u043d\u043a\u0438. \u0418\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0430\u0432\u0442\u043e\u0440\u0430 <\/figcaption><\/figure>\n<p><strong>Matplotlib<\/strong><\/p>\n<p>\u0412 Matplotlib \u043d\u0435\u0442 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0432\u043e\u0440\u043e\u043d\u043a\u0443, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u0445\u043e\u0434\u0438\u0442\u044c \u0438\u0437 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u0439 \u043b\u0438\u043d\u0435\u0439\u0447\u0430\u0442\u043e\u0439 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u044b, \u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u043c \u0432\u043e\u0440\u043e\u043d\u043a\u0443 \u0438\u0437 \u043d\u0435\u0435.<\/p>\n<pre><code class=\"python\">import matplotlib.pyplot as plt y = [5,4,3,2,1] x = [80,73,58,42,23] plt.barh(y, x)<\/code><\/pre>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0431\u043b\u0438\u0437\u043a\u043e \u043a \u0442\u043e\u043c\u0443, \u0447\u0435\u0433\u043e \u043c\u044b \u0434\u043e\u0431\u0438\u0432\u0430\u0435\u043c\u0441\u044f, \u0442\u0430\u043a \u043f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u043d\u0435 \u043e\u0441\u0442\u0430\u0442\u044c\u0441\u044f \u0437\u0434\u0435\u0441\u044c \u0438 \u043d\u0435 \u043e\u0442\u0434\u0435\u043b\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0433\u0438\u0441\u0442\u043e\u0433\u0440\u0430\u043c\u043c\u043e\u0439?<\/p>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0440\u043e\u0441\u0442\u0435\u043d\u044c\u043a\u043e\u0439 \u0433\u0438\u0441\u0442\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0438 \u043b\u0435\u0433\u0447\u0435, \u043d\u043e \u0432\u044b\u0431\u043e\u0440 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u044b-\u0432\u043e\u0440\u043e\u043d\u043a\u0438 \u043c\u043e\u0436\u0435\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0437\u0430\u0438\u043c\u043e\u0441\u0432\u044f\u0437\u044c \u043c\u0435\u0436\u0434\u0443 \u0441\u0442\u043e\u043b\u0431\u0446\u0430\u043c\u0438 \u0431\u043e\u043b\u0435\u0435 \u044f\u0432\u043d\u043e\u0439 \u0438 \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u0442\u044c \u043d\u0430\u0448\u0443 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0432 \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u0438\u0432\u043b\u0435\u043a\u0430\u0442\u0435\u043b\u044c\u043d\u0443\u044e.<\/p>\n<p>\u0425\u043e\u0440\u043e\u0448\u043e, \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u0441\u0442\u043e\u043b\u0431\u0446\u0443 \u0437\u0430 \u0440\u0430\u0437 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u00ab<em>left<\/em>\u00bb, \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u0440\u0435\u0433\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0435. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u043a\u0430\u043a \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c.<\/p>\n<pre><code class=\"python\">y = [5,4,3,2,1] x = [80,73,58,42,23] x_max = 100 x_min = 0 for idx, val in enumerate(x):     plt.barh(y[idx], x[idx], left = idx+5) plt.xlim(x_min, x_max)<\/code><\/pre>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440 \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0430\u0432\u0435\u043d x, \u0438 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u043e\u0441\u0438 x, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0430\u0432\u0435\u043d 100.<\/p>\n<p>\u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u043c\u0435\u0436\u0434\u0443 \u044d\u0442\u0438\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u2013 \u044d\u0442\u043e \u043f\u0443\u0441\u0442\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e. \u0427\u0442\u043e\u0431\u044b \u043e\u0442\u0446\u0435\u043d\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u043e\u043b\u0431\u0446\u044b \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0443\u0441\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u0441 \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0437 \u0441\u0442\u043e\u0440\u043e\u043d.<\/p>\n<p>\u0418\u0442\u0430\u043a, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e:\u00a0<\/p>\n<p><em>left = (\u0440\u0430\u0437\u043c\u0435\u0440 \u0441\u0442\u043e\u043b\u0431\u0446\u0430 \u2013 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u043e\u0441\u0438 x) \/ 2<\/em><\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442:<\/p>\n<pre><code class=\"python\">y = [5,4,3,2,1] x = [80,73,58,42,23] x_max = 100 x_min = 0 for idx, val in enumerate(x):     left = (x_max - val)\/2     plt.barh(y[idx], x[idx], left = left, color='grey') plt.xlim(x_min, x_max)<\/code><\/pre>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u041e\u0442\u043b\u0438\u0447\u043d\u043e! \u041e\u0434\u043d\u0430\u043a\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e\u0431 \u043e\u0441\u044f\u0445 \u043a\u0430\u043a\u0430\u044f-\u0442\u043e \u0431\u0435\u0441\u043f\u043e\u043b\u0435\u0437\u043d\u0430\u044f, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0443 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432 \u043d\u0435 \u043e\u0434\u043d\u0430 \u0438 \u0442\u0430 \u0436\u0435 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430. \u041d\u0443\u0436\u043d\u043e \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u044d\u0442\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043d\u0430 \u0441\u0442\u043e\u043b\u0431\u0446\u0430\u0445 \u0438 \u0441\u043e\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u0438\u0445.<\/p>\n<pre><code class=\"python\">y = [5,4,3,2,1] x = [80,73,58,42,23] x_max = 100 x_min = 0 fig, ax = plt.subplots(1, figsize=(12,6)) for idx, val in enumerate(x):     left = (x_max - val)\/2     plt.barh(y[idx], x[idx], left = left, color='grey', height=1, edgecolor='black')     # value     plt.text(50, y[idx], x[idx], ha='center', fontproperties=font,              fontsize=16, color='#2A2A2A') plt.axis('off') plt.xlim(x_min, x_max)<\/code><\/pre>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0425\u043e\u0440\u043e\u0448\u043e, \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a, \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044f\u0440\u043b\u044b\u043a\u043e\u0432 \u043d\u0430 \u0441\u0442\u043e\u043b\u0431\u0446\u0430\u0445 \u0438 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u0442\u044c \u043d\u0430 \u044d\u0442\u043e\u043c.<\/p>\n<p>\u041d\u043e \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0443\u0441\u043b\u0430\u0434\u044b \u0434\u043b\u044f \u0433\u043b\u0430\u0437 \u0441\u043c\u043e\u0442\u0440\u044f\u0449\u0435\u0433\u043e \u0438 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0442\u0435\u043d\u044c, \u0441\u043e\u0435\u0434\u0438\u043d\u044f\u044e\u0449\u0443\u044e \u0441\u0442\u043e\u043b\u0431\u0446\u044b, \u0432\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043a\u043b\u0435\u0438\u0432\u0430\u0442\u044c \u0438\u0445 \u0432\u043c\u0435\u0441\u0442\u0435. \u0422\u0430\u043a \u0432\u0430\u0448\u0430 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0430 \u0441\u0442\u0430\u043d\u0435\u0442 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u0435\u0435 \u0438 \u0441\u0432\u044f\u0437\u044c \u043c\u0435\u0436\u0434\u0443 \u0441\u0442\u043e\u043b\u0431\u0446\u0430\u043c\u0438 \u0441\u0442\u0430\u043d\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u0442\u043a\u043e\u0439.<\/p>\n<p>\u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043d\u0430\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435:<\/p>\n<pre><code class=\"python\">from matplotlib import font_manager as fm # funnel chart y = [5,4,3,2,1] x = [80,73,58,42,23] labels = ['Hot Leads', 'Samples Sent', 'Quotes', 'Negotiations', 'Sales'] x_max = 100 x_min = 0 x_range = x_max - x_min fpath = \"fonts\/NotoSans-Regular.ttf\" font = fm.FontProperties(fname=fpath)<\/code><\/pre>\n<p>\u0418 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0434\u0435\u0442\u0430\u043b\u0435\u0439.<\/p>\n<pre><code class=\"python\">fig, ax = plt.subplots(1, figsize=(12,6)) for idx, val in enumerate(x):     left = (x_range - val)\/2     plt.barh(y[idx], x[idx], left = left, color='#808B96',              height=.8, edgecolor='black')     # label     plt.text(50, y[idx]+0.1, labels[idx], ha='center',               fontproperties=font, fontsize=16, color='#2A2A2A')     # value     plt.text(50, y[idx]-0.3, x[idx], ha='center',              fontproperties=font, fontsize=16, color='#2A2A2A')      plt.xlim(x_min, x_max) plt.axis('off') plt.title('Beskar Forging Services Inc.', fontproperties=font, loc='center', fontsize=24, color='#2A2A2A') plt.show()<\/code><\/pre>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p><em>*\u0428\u0440\u0438\u0444\u0442 \u0432\u0437\u044f\u0442 \u043e\u0442\u0441\u044e\u0434\u0430: <\/em><a href=\"https:\/\/fonts.google.com\/specimen\/Noto+Sans\"><em><u>https:\/\/fonts.google.com\/specimen\/Noto+Sans<\/u><\/em><\/a><\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0434\u0435\u043c \u043b\u0438\u043d\u0438\u044e \u043e\u0442 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u0441\u0442\u043e\u043b\u0431\u0446\u0430 \u043a \u0434\u0440\u0443\u0433\u043e\u0439. \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>left<\/em>, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0439\u0442\u0438 \u043d\u0430\u0447\u0430\u043b\u043e \u0438 \u043a\u043e\u043d\u0435\u0446 \u0441\u0442\u043e\u043b\u0431\u0446\u0430, \u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>y<\/em>, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0439\u0442\u0438 \u0435\u0433\u043e \u0446\u0435\u043d\u0442\u0440.<\/p>\n<pre><code class=\"python\">fig, ax = plt.subplots(1, figsize=(12,6)) for idx, val in enumerate(x):     left = (x_range - val)\/2     plt.barh(y[idx], x[idx], left = left, color='#808B96', height=.8, edgecolor='black')     # label     plt.text(50, y[idx]+0.1, labels[idx], ha='center',              fontproperties=font, fontsize=16, color='#2A2A2A')     # value     plt.text(50, y[idx]-0.3, x[idx], ha='center',              fontproperties=font, fontsize=16, color='#2A2A2A')          plt.plot([left, 100-left], [y[idx], y[idx]]) plt.xlim(x_min, x_max) plt.axis('off') plt.title('Beskar Forging Services Inc.', fontproperties=font, loc='center', fontsize=24, color='#2A2A2A') plt.show()<\/code><\/pre>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0434\u0432\u0438\u043d\u0435\u043c \u044d\u0442\u0443 \u043b\u0438\u043d\u0438\u044e \u0432 \u043d\u0438\u0436\u043d\u044e\u044e \u0447\u0430\u0441\u0442\u044c \u0441\u0442\u043e\u043b\u0431\u0446\u0430, \u0430 \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u2013 \u0435\u0435 \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u0432\u043e\u0432\u0441\u0435, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0442\u0430\u043c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u043d\u0435 \u0431\u0443\u0434\u0435\u0442.\u00a0<\/p>\n<p>\u0412\u044b\u0441\u043e\u0442\u0430 \u0441\u0442\u043e\u043b\u0431\u0446\u0430 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u043d\u0430 0.8, \u043f\u043e\u044d\u0442\u043e\u043c\u0443, \u0447\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043b\u0438\u043d\u0438\u044e \u0432\u043d\u0438\u0437, \u043d\u0443\u0436\u043d\u043e \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c <em>y<\/em> \u0434\u043e 0.4.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0432\u0435\u0440\u0448\u0438\u043d\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430.<\/p>\n<pre><code class=\"python\">fig, ax = plt.subplots(1, figsize=(12,6)) for idx, val in enumerate(x):     left = (x_range - val)\/2     plt.barh(y[idx], x[idx], left = left, color='#808B96', height=.8, edgecolor='black')     # label     plt.text(50, y[idx]+0.1, labels[idx], ha='center',              fontproperties=font, fontsize=16, color='#2A2A2A')     # value     plt.text(50, y[idx]-0.3, x[idx], ha='center',              fontproperties=font, fontsize=16, color='#2A2A2A')          if idx != len(x)-1:         next_left = (x_range - x[idx+1])\/2         plt.plot([left, 100-left],                   [y[idx]-0.4, y[idx]-0.4])         plt.plot([next_left, 100-next_left],                   [y[idx+1]+0.4, y[idx+1]+0.4]) plt.xlim(x_min, x_max) plt.axis('off') plt.title('Beskar Forging Services Inc.', fontproperties=font, loc='center', fontsize=24, color='#2A2A2A') plt.show()<\/code><\/pre>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041c\u044b \u043d\u0430\u0448\u043b\u0438 \u0432\u0441\u0435 \u0442\u043e\u0447\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c. \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u044d\u0442\u0438 \u0442\u043e\u0447\u043a\u0438 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043b\u0438 \u043c\u044b \u043d\u0443\u0436\u043d\u0443\u044e \u0444\u043e\u0440\u043c\u0443.<\/p>\n<p>\u041d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u043f\u0440\u043e\u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0432\u0443\u044e \u0442\u043e\u0447\u043a\u0443 \u0432 \u0441\u0430\u043c\u043e\u043c \u043a\u043e\u043d\u0446\u0435, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u043c\u043a\u043d\u0443\u0442\u044c \u043c\u043d\u043e\u0433\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a.<\/p>\n<pre><code class=\"python\">fig, ax = plt.subplots(1, figsize=(12,6)) for idx, val in enumerate(x):     left = (x_range - val)\/2     plt.barh(y[idx], x[idx], left = left, color='#808B96', height=.8, edgecolor='black')     # label     plt.text(50, y[idx]+0.1, labels[idx], ha='center',              fontproperties=font, fontsize=16, color='#2A2A2A')     # value     plt.text(50, y[idx]-0.3, x[idx], ha='center',              fontproperties=font, fontsize=16, color='#2A2A2A')          if idx != len(x)-1:         next_left = (x_range - x[idx+1])\/2         shadow_x = [left, next_left,                      100-next_left, 100-left, left]                  shadow_y = [y[idx]-0.4, y[idx+1]+0.4,                      y[idx+1]+0.4, y[idx]-0.4, y[idx]-0.4]         plt.plot(shadow_x, shadow_y) plt.xlim(x_min, x_max) plt.axis('off') plt.title('Beskar Forging Services Inc.', fontproperties=font, loc='center', fontsize=24, color='#2A2A2A') plt.show()<\/code><\/pre>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0418\u0434\u0435\u0430\u043b\u044c\u043d\u043e. \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c <code>.plot<\/code> \u043d\u0430 <code>.fill<\/code> \u0438 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0430 \u0433\u043e\u0442\u043e\u0432\u0430.<\/p>\n<pre><code class=\"python\">fig, ax = plt.subplots(1, figsize=(12,6)) for idx, val in enumerate(x):     left = (x_range - val)\/2     plt.barh(y[idx], x[idx], left = left,               color='#808B96', height=.8)     # label     plt.text(50, y[idx]+0.1, labels[idx], ha='center',              fontproperties=font, fontsize=16, color='#2A2A2A')     # value     plt.text(50, y[idx]-0.3, x[idx], ha='center',              fontproperties=font, fontsize=16, color='#2A2A2A')          if idx != len(x)-1:         next_left = (x_range - x[idx+1])\/2         shadow_x = [left, next_left,                      100-next_left, 100-left, left]                  shadow_y = [y[idx]-0.4, y[idx+1]+0.4,                      y[idx+1]+0.4, y[idx]-0.4, y[idx]-0.4]         plt.fill(shadow_x, shadow_y, color='grey', alpha=0.6) plt.xlim(x_min, x_max) plt.axis('off') plt.title('Beskar Forging Services Inc.', fontproperties=font, loc='center', fontsize=24, color='#2A2A2A') plt.show()<\/code><\/pre>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0412\u043e\u0442 \u0438 \u043e\u043d\u043e!<\/p>\n<p>\u0420\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u043e\u0440\u043e\u043d\u043a\u0438 \u0441 Matplotlib \u043c\u043e\u0436\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u0435\u0440\u0435\u0440\u0430\u0441\u0442\u0438 \u0438\u0437 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u0432 \u0441\u043b\u043e\u0436\u043d\u0443\u044e.\u00a0<\/p>\n<p>\u041d\u043e \u0432 \u044d\u0442\u043e\u043c \u0438 \u0435\u0441\u0442\u044c \u043e\u0441\u043e\u0431\u0430\u044f \u043f\u0440\u0435\u043b\u0435\u0441\u0442\u044c Matplotlib, \u0432\u0435\u0434\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043d\u0430\u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0441\u0435, \u0447\u0442\u043e \u0434\u0443\u0448\u0435 \u0443\u0433\u043e\u0434\u043d\u043e.<\/p>\n<p><strong>Plotly<\/strong><\/p>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u043c\u0443 \u0441\u043f\u043e\u0441\u043e\u0431\u0443 \u0434\u043e\u0441\u0442\u0438\u0447\u044c \u0442\u0435\u0445 \u0436\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432, \u0438 \u043d\u0430\u0440\u0438\u0441\u0443\u0435\u043c \u0432\u043e\u0440\u043e\u043d\u043a\u0443 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Plotly.<\/p>\n<pre><code class=\"python\">import plotly.express as px data = dict(values=[80,73,58,42,23],             labels=['Hot Leads', 'Samples Sent',                      'Quotes', 'Negotiations', 'Sales']) fig = px.funnel(data, y='labels', x='values') fig.show()<\/code><\/pre>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041f\u043e\u0442\u0440\u044f\u0441\u0430\u044e\u0449\u0435. \u0423 Plotly \u0435\u0441\u0442\u044c \u043c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c-\u0432\u043e\u0440\u043e\u043d\u043e\u043a, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u044b \u043b\u0438\u0448\u044c \u0434\u0430\u043d\u043d\u044b\u0435, \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u0434\u0435\u043b\u0430\u044e\u0442 \u0437\u0430 \u043d\u0430\u0441.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0443 Plotly \u0435\u0441\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043e\u043f\u0446\u0438\u0439 \u0434\u043b\u044f \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c.<\/p>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0437\u0434\u0435\u0441\u044c \u0432\u044b \u043d\u0435 \u0442\u0430\u043a \u0445\u043e\u0440\u043e\u0448\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u0442\u0435 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e, \u043a\u0430\u043a \u0434\u043e \u044d\u0442\u043e\u0433\u043e, \u043d\u043e \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0432\u043e\u0440\u043e\u043d\u043a\u0443 \u0442\u0430\u043a \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0443\u0434\u043e\u0431\u043d\u0435\u0435.<\/p>\n<pre><code class=\"python\">data = dict(Quantity=[80, 73, 58, 42, 23,                       180, 120, 82, 51, 33,                       109, 78, 62, 44, 22],                  Stage=['Hot Leads', 'Samples Sent', 'Quotes',                    'Negotiations', 'Sales']*3,                  Location=['Tatooine']*5 + ['Mandalore']*5 + ['Nevarro']*5)      fig = px.funnel(data, y='Stage', x='Quantity', color='Location',                 color_discrete_map={\"Tatooine\": \"#374B53\",                                      \"Mandalore\": \"#617588\",                                     \"Nevarro\": \"#A4B7C8\"},                 template=\"simple_white\",                 title='Beskar Forging Services Inc.',                 labels={\"Stage\": \"\"}) fig.show() <\/code><\/pre>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0418 \u0432\u0441\u0435! \u041c\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438, \u043a\u0430\u043a \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0432\u043e\u0440\u043e\u043d\u043a\u0443 \u0441 \u043d\u0443\u043b\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Matplotlib, \u0438 \u0443\u0432\u0438\u0434\u0435\u043b\u0438 \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u043b\u043e\u0436\u043d\u0438\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e. \u0410 \u0435\u0449\u0435 \u043c\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b\u0438 \u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u044b-\u0432\u043e\u0440\u043e\u043d\u043a\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Plotly \u0438 \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u043b\u0438\u0441\u044c \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0432\u0430\u0440\u0438\u0430\u0446\u0438\u044f\u043c\u0438 \u0435\u0435 \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0430\u0446\u0438\u0438.<\/p>\n<p>\u0421\u043f\u0430\u0441\u0438\u0431\u043e, \u0447\u0442\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043b\u0438. \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0432\u0430\u043c \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u043b\u043e\u0441\u044c.<\/p>\n<hr\/>\n<blockquote>\n<p>\u041c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043a\u0443\u0440\u0441\u0430 <a href=\"https:\/\/otus.pw\/G8z8\/\">\u00abPython \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0438\u00bb. <\/a><\/p>\n<p>\u0412\u0441\u0435\u0445 \u0436\u0435\u043b\u0430\u044e\u0449\u0438\u0445 \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0430\u0435\u043c \u043d\u0430 demo-\u0437\u0430\u043d\u044f\u0442\u0438\u0435 <strong>\u00ab\u041f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 Python \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u00bb<\/strong>. \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439<\/p>\n<\/blockquote>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-412978","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/412978","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=412978"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/412978\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=412978"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=412978"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=412978"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}