

{"id":22224,"date":"2018-07-22T03:15:10","date_gmt":"2018-07-22T03:15:10","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=22224"},"modified":"2026-04-29T16:19:55","modified_gmt":"2026-04-29T10:49:55","slug":"python-charts","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/python-charts\/","title":{"rendered":"Python Charts &#8211; Bubble, 3D Charts with Properties of Chart"},"content":{"rendered":"<div class='__iawmlf-post-loop-links' style='display:none;' data-iawmlf-post-links='[{&quot;id&quot;:1875,&quot;href&quot;:&quot;https:\\\/\\\/en.wikipedia.org\\\/wiki\\\/Matplotlib&quot;,&quot;archived_href&quot;:&quot;http:\\\/\\\/web-wp.archive.org\\\/web\\\/20250516001006\\\/https:\\\/\\\/en.wikipedia.org\\\/wiki\\\/Matplotlib&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2025-12-10 06:05:48&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-08 15:17:28&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-16 03:47:44&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-26 20:29:22&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-06 21:27:06&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-11 15:06:59&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-15 20:42:43&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-19 21:24:38&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-11 21:35:31&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-25 11:25:23&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-30 16:13:30&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-04-20 15:12:36&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-29 05:33:33&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-12 16:39:49&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-06-01 15:57:58&quot;,&quot;http_code&quot;:200}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-06-01 15:57:58&quot;,&quot;http_code&quot;:200},&quot;process&quot;:&quot;done&quot;}]'><\/div>\n<p>In our last tutorial, we studied the <a href=\"https:\/\/data-flair.training\/blogs\/python-array-module\/\" target=\"_blank\" rel=\"noopener\"><strong>Python Array Module<\/strong><\/a>. Today, we will take a quick look at Python Charts. Here, we will cover the Python Bubble Charts and 3D charts in Python. Then, we\u2019ll learn about the properties of charts and will try to style those charts in <a href=\"https:\/\/data-flair.training\/blogs\/python-tutorial-for-beginners\/\" target=\"_blank\" rel=\"noopener\"><strong>Python programming<\/strong><\/a>.<\/p>\n<p>It\u2019s not just about making a chart; it\u2019s about making these charts look professional. We will learn how to change colors, labels, and styles so your data doesn&#8217;t just work; it looks great. Now create your own Python project in your own style.<\/p>\n<h3>Prerequisites for Python Charts<\/h3>\n<p>For this Python Chart tutorial, we will import three libraries- <strong><a href=\"https:\/\/data-flair.training\/blogs\/python-matplotlib-tutorial\/\" target=\"_blank\" rel=\"noopener\">matplotlib<\/a><\/strong>, <strong><a href=\"https:\/\/data-flair.training\/blogs\/python-numpy-tutorial\/\" target=\"_blank\" rel=\"noopener\">numpy<\/a><\/strong>, and pandas.<br \/>\nYou can install these <strong><a href=\"https:\/\/data-flair.training\/blogs\/python-library\/\" target=\"_blank\" rel=\"noopener\">Python Libraries<\/a><\/strong> using the following commands-<\/p>\n<pre class=\"EnlighterJSRAW\">pip install matplotlib<\/pre>\n<pre class=\"EnlighterJSRAW\">pip install numpy\r\n<\/pre>\n<pre class=\"EnlighterJSRAW\">pip install pandas<\/pre>\n<p>You can import these as-<\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; from matplotlib import pyplot as plt\r\n&gt;&gt;&gt; import numpy as np\r\n&gt;&gt;&gt; import pandas as pd<\/pre>\n<p><strong><a href=\"https:\/\/data-flair.training\/blogs\/python-modules-vs-packages\/\" target=\"_blank\" rel=\"noopener\">Do you know about Python Modules vs Packages<\/a><\/strong><\/p>\n<h3 class=\"western\">Python Bubble Charts<\/h3>\n<p>First, let\u2019s talk about bubble charts in Python. Such a chart is a scatter plot with an extra dimension, which makes it apparently 3-dimensional. This means larger bubbles denote higher values. Let\u2019s build a Python bubble plot.<\/p>\n<div id=\"attachment_22257\" style=\"width: 1210px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Python-Bubble-Charts-01.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-22257\" class=\"wp-image-22257 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Python-Bubble-Charts-01.jpg\" alt=\"Python Charts - Bubble, 3D Charts with Properties of Chart\" width=\"1200\" height=\"628\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Python-Bubble-Charts-01.jpg 1200w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Python-Bubble-Charts-01-150x79.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Python-Bubble-Charts-01-300x157.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Python-Bubble-Charts-01-768x402.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Python-Bubble-Charts-01-1024x536.jpg 1024w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/a><p id=\"caption-attachment-22257\" class=\"wp-caption-text\">Python Charts &#8211; Python Bubble Charts<\/p><\/div>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; x=np.random.rand(30)\r\n&gt;&gt;&gt; y=np.random.rand(30)\r\n&gt;&gt;&gt; z=np.random.rand(50)\r\n&gt;&gt;&gt; plt.scatter(x,y,s=z*777) #s is for global size<\/pre>\n<p><strong>&lt;matplotlib.collections.PathCollection object at 0x0863FAD0&gt;<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.show()<\/pre>\n<div id=\"attachment_22231\" style=\"width: 572px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/bubble-1.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-22231\" class=\"wp-image-22231 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/bubble-1.png\" alt=\"Python Charts\" width=\"562\" height=\"425\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/bubble-1.png 562w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/bubble-1-150x113.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/bubble-1-300x227.png 300w\" sizes=\"auto, (max-width: 562px) 100vw, 562px\" \/><\/a><p id=\"caption-attachment-22231\" class=\"wp-caption-text\">Python Charts &#8211;\u00a0Python Bubble Charts<\/p><\/div>\n<h4 class=\"western\">a. Setting bubble color<\/h4>\n<p>Using the <i>color<\/i> parameter, you can assign a color to your bubbles chart.<\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.scatter(x,y,s=z*777,c='Chartreuse')<\/pre>\n<p><strong>&lt;matplotlib.collections.PathCollection object at 0x0A258DB0&gt;<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.show()<\/pre>\n<div id=\"attachment_22230\" style=\"width: 578px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/bubblechartreuse-1.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-22230\" class=\"wp-image-22230 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/bubblechartreuse-1.png\" alt=\"Python Charts\" width=\"568\" height=\"432\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/bubblechartreuse-1.png 568w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/bubblechartreuse-1-150x114.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/bubblechartreuse-1-300x228.png 300w\" sizes=\"auto, (max-width: 568px) 100vw, 568px\" \/><\/a><p id=\"caption-attachment-22230\" class=\"wp-caption-text\">Python Charts &#8211;\u00a0Setting bubble color<\/p><\/div>\n<p>You can even assign random colors to different bubbles chart in Python.<\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; colors=np.random.rand(30)\r\n&gt;&gt;&gt; plt.scatter(x,y,s=z*777,c=colors,alpha=0.5) #alpha for transparency<\/pre>\n<p><strong>&lt;matplotlib.collections.PathCollection object at 0x0A295EF0&gt;<\/strong><br \/>\n<strong><a href=\"https:\/\/data-flair.training\/blogs\/python-datetime-module\/\" target=\"_blank\" rel=\"noopener\">Read about Python Datetime Module with Quick Examples<\/a><\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.show()<\/pre>\n<div id=\"attachment_22232\" style=\"width: 572px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/bubblecolor.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-22232\" class=\"wp-image-22232 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/bubblecolor.png\" alt=\"Python Charts\" width=\"562\" height=\"424\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/bubblecolor.png 562w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/bubblecolor-150x113.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/bubblecolor-300x226.png 300w\" sizes=\"auto, (max-width: 562px) 100vw, 562px\" \/><\/a><p id=\"caption-attachment-22232\" class=\"wp-caption-text\">Python Charts &#8211;\u00a0Setting bubble color<\/p><\/div>\n<h4 class=\"western\">b. Setting bubble shape<\/h4>\n<p>You can also choose what shape to apply to your bubble chart.<\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.scatter(x,y,s=z*3001,marker='D')<\/pre>\n<p><strong>&lt;matplotlib.collections.PathCollection object at 0x0A2D0E70&gt;<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.show()<\/pre>\n<div id=\"attachment_22233\" style=\"width: 585px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/squares.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-22233\" class=\"wp-image-22233 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/squares.png\" alt=\"Python Charts\" width=\"575\" height=\"436\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/squares.png 575w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/squares-150x114.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/squares-300x227.png 300w\" sizes=\"auto, (max-width: 575px) 100vw, 575px\" \/><\/a><p id=\"caption-attachment-22233\" class=\"wp-caption-text\">Python Charts &#8211;\u00a0Setting bubble shape<\/p><\/div>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.scatter(x,y,s=z*3001,marker='&lt;',color='brown')<\/pre>\n<p><strong>&lt;matplotlib.collections.PathCollection object at 0x09E15A50&gt;<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.show()\r\n<\/pre>\n<div id=\"attachment_22234\" style=\"width: 572px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/triangle.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-22234\" class=\"wp-image-22234 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/triangle.png\" alt=\"Python Charts\" width=\"562\" height=\"420\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/triangle.png 562w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/triangle-150x112.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/triangle-300x224.png 300w\" sizes=\"auto, (max-width: 562px) 100vw, 562px\" \/><\/a><p id=\"caption-attachment-22234\" class=\"wp-caption-text\">Setting bubble shape<\/p><\/div>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.scatter(x,y,s=z*3001,marker='*',color='pink')<\/pre>\n<p><strong>&lt;matplotlib.collections.PathCollection object at 0x09E508F0&gt;<\/strong><br \/>\n<strong><a href=\"https:\/\/data-flair.training\/blogs\/python-forensics\/\" target=\"_blank\" rel=\"noopener\">Have a Look at Python Forensics &#8211; Hash Function, Virtualization &amp; much more<\/a><\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.show()\r\n<\/pre>\n<div id=\"attachment_22235\" style=\"width: 571px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/stars.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-22235\" class=\"wp-image-22235 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/stars.png\" alt=\"Python Charts\" width=\"561\" height=\"428\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/stars.png 561w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/stars-150x114.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/stars-300x229.png 300w\" sizes=\"auto, (max-width: 561px) 100vw, 561px\" \/><\/a><p id=\"caption-attachment-22235\" class=\"wp-caption-text\">Setting bubble shape<\/p><\/div>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.scatter(x,y,s=z*3001,marker='8',color='lavender')<\/pre>\n<p><strong>&lt;matplotlib.collections.PathCollection object at 0x08B9AC90&gt;<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.show()<\/pre>\n<div id=\"attachment_22236\" style=\"width: 572px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/hexagons.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-22236\" class=\"wp-image-22236 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/hexagons.png\" alt=\"Python Charts\" width=\"562\" height=\"424\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/hexagons.png 562w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/hexagons-150x113.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/hexagons-300x226.png 300w\" sizes=\"auto, (max-width: 562px) 100vw, 562px\" \/><\/a><p id=\"caption-attachment-22236\" class=\"wp-caption-text\">Setting bubble shape<\/p><\/div>\n<h4 class=\"western\">c. Setting the edges for your Python bubbles charts<\/h4>\n<p>You can also set edges to your Python bubble chart.<\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.scatter(x,y,s=z*4000,c=\"beige\",alpha=0.4,linewidth=7)<\/pre>\n<p><strong>&lt;matplotlib.collections.PathCollection object at 0x094035B0&gt;<\/strong><br \/>\n<strong><a href=\"https:\/\/data-flair.training\/blogs\/python-switch-case\/\" target=\"_blank\" rel=\"noopener\">Do you know how to implement a Python Switch Case Statement<\/a> <\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.show()<\/pre>\n<div id=\"attachment_22237\" style=\"width: 574px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/edges.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-22237\" class=\"wp-image-22237 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/edges.png\" alt=\"Python Charts\" width=\"564\" height=\"424\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/edges.png 564w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/edges-150x113.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/edges-300x226.png 300w\" sizes=\"auto, (max-width: 564px) 100vw, 564px\" \/><\/a><p id=\"caption-attachment-22237\" class=\"wp-caption-text\">Setting the edges for your bubble charts<\/p><\/div>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.scatter(x,y,s=z*4000,c=\"beige\",linewidth=7,edgecolors='brown')<\/pre>\n<p><strong>&lt;matplotlib.collections.PathCollection object at 0x0A1EADD0&gt;<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.show()<\/pre>\n<div id=\"attachment_22238\" style=\"width: 576px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/edgecolors.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-22238\" class=\"wp-image-22238 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/edgecolors.png\" alt=\"Python Charts\" width=\"566\" height=\"425\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/edgecolors.png 566w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/edgecolors-150x113.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/edgecolors-300x225.png 300w\" sizes=\"auto, (max-width: 566px) 100vw, 566px\" \/><\/a><p id=\"caption-attachment-22238\" class=\"wp-caption-text\">Setting the edges for your bubbles charts<\/p><\/div>\n<h4 class=\"western\">d. Mapping a color to a plot<\/h4>\n<p>Let\u2019s try mapping greys to it.<\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt;plt.scatter(x,y,s=z*2000,c=x,cmap=\"Greys\",alpha=0.4,edgecolors=\"grey\",linewidth=2)<\/pre>\n<p><strong>&lt;matplotlib.collections.PathCollection object at 0x08AB91F0&gt;<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.show()<\/pre>\n<div id=\"attachment_22239\" style=\"width: 570px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/greys.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-22239\" class=\"wp-image-22239 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/greys.png\" alt=\"Python Charts\" width=\"560\" height=\"424\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/greys.png 560w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/greys-150x114.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/greys-300x227.png 300w\" sizes=\"auto, (max-width: 560px) 100vw, 560px\" \/><\/a><p id=\"caption-attachment-22239\" class=\"wp-caption-text\">Mapping a color to a plot<\/p><\/div>\n<h3 class=\"western\">Python 3D Charts<\/h3>\n<p>It is possible to render your Python charts in three dimensions. Here\u2019s how we do that with Python 3D charts.<br \/>\n<strong><a href=\"https:\/\/data-flair.training\/blogs\/python-database-access\/\" target=\"_blank\" rel=\"noopener\">Let&#8217;s Learn Python Database Access \u2013 Python 3 MySQL<\/a><\/strong><\/p>\n<p><strong>a. Python 3D Scatterplots<\/strong><\/p>\n<p>Here, we use the mplot3D toolkit from Python Matplotlib.<\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; from mpl_toolkits.mplot3d import Axes3D\r\n&gt;&gt;&gt; df=pd.DataFrame({'X':range(1,111),'Y':np.random.randn(110)*13+range(1,111), 'Z':(np.random.randn(110)*13+range(1,111))*2})\r\n&gt;&gt;&gt; fig=plt.figure()\r\n&gt;&gt;&gt; ax=fig.add_subplot(121,projection='3d')\r\n&gt;&gt;&gt; ax.scatter(df['X'],df['Y'],df['Z'],c='pink',s=60)<\/pre>\n<p><strong>&lt;mpl_toolkits.mplot3d.art3d.Path3DCollection object at 0x0A126CF0&gt;<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; ax.view_init(27,200)\r\n&gt;&gt;&gt; plt.show()<\/pre>\n<div id=\"attachment_22240\" style=\"width: 254px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/3D.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-22240\" class=\"wp-image-22240 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/3D.png\" alt=\"Python Charts\" width=\"244\" height=\"359\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/3D.png 244w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/3D-102x150.png 102w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/3D-204x300.png 204w\" sizes=\"auto, (max-width: 244px) 100vw, 244px\" \/><\/a><p id=\"caption-attachment-22240\" class=\"wp-caption-text\">Python 3D Scatterplots<\/p><\/div>\n<h3 class=\"western\">Python Charts Properties<\/h3>\n<p>Let\u2019s demonstrate these online Python graphs.<\/p>\n<div id=\"attachment_22258\" style=\"width: 1210px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Python-Charts-Properties-01.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-22258\" class=\"wp-image-22258 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Python-Charts-Properties-01.jpg\" alt=\"Python Charts\" width=\"1200\" height=\"628\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Python-Charts-Properties-01.jpg 1200w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Python-Charts-Properties-01-150x79.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Python-Charts-Properties-01-300x157.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Python-Charts-Properties-01-768x402.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Python-Charts-Properties-01-1024x536.jpg 1024w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/a><p id=\"caption-attachment-22258\" class=\"wp-caption-text\">Python Bubble Charts<\/p><\/div>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; x=np.arange(0,7)\r\n&gt;&gt;&gt; from scipy import sin\r\n&gt;&gt;&gt; y=sin(x)\r\n&gt;&gt;&gt; plt.plot(x,y)<\/pre>\n<p><strong>[&lt;matplotlib.lines.Line2D object at 0x0BEE0150&gt;]<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.show()<\/pre>\n<div id=\"attachment_22247\" style=\"width: 583px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/sin-1.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-22247\" class=\"wp-image-22247 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/sin-1.png\" alt=\"Python Charts\" width=\"573\" height=\"429\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/sin-1.png 573w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/sin-1-150x112.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/sin-1-300x225.png 300w\" sizes=\"auto, (max-width: 573px) 100vw, 573px\" \/><\/a><p id=\"caption-attachment-22247\" class=\"wp-caption-text\">Properties of Charts in\u00a0Python<\/p><\/div>\n<h4 class=\"western\">a. Titling the graph and labeling the axes<\/h4>\n<p>Using the title(), xlabel(), and ylabel() methods, we can do the needful.<\/p>\n<div id=\":ds.ma\" class=\"Mu SP\">\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.title('Sine Wave')<\/pre>\n<p><span class=\"tL8wMe EMoHub\" dir=\"ltr\"><span class=\"tL8wMe EMoHub\" dir=\"ltr\"><span class=\"tL8wMe EMoHub\" dir=\"ltr\"><span class=\"tL8wMe EMoHub\" dir=\"ltr\"><strong>Text(0.5,1,&#8217;Sine Wave&#8217;)<\/strong><br \/>\n<\/span><\/span><\/span><\/span><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.xlabel('x')<\/pre>\n<p><span class=\"tL8wMe EMoHub\" dir=\"ltr\"><span class=\"tL8wMe EMoHub\" dir=\"ltr\"><span class=\"tL8wMe EMoHub\" dir=\"ltr\"><strong>Text(0.5,0,&#8217;x&#8217;)<\/strong><br \/>\n<\/span><\/span><\/span><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.ylabel('y')<\/pre>\n<p><span class=\"tL8wMe EMoHub\" dir=\"ltr\"><span class=\"tL8wMe EMoHub\" dir=\"ltr\"><strong>Text(0,0.5,&#8217;y&#8217;)<\/strong><br \/>\n<\/span><\/span><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.plot(x,y)<\/pre>\n<\/div>\n<div id=\":eo.ma\" class=\"Mu SP\"><span id=\":eo.co\" class=\"tL8wMe EMoHub\" dir=\"ltr\"><strong>[&lt;matplotlib.lines.Line2D object at 0x043BDC70&gt;]<\/strong><\/span><\/div>\n<div class=\"Mu SP\">\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.show()<\/pre>\n<\/div>\n<div class=\"Mu SP\">\n<div id=\"attachment_22437\" style=\"width: 618px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/python-chart.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-22437\" class=\"wp-image-22437 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/python-chart.png\" alt=\"Python Charts\" width=\"608\" height=\"453\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/python-chart.png 608w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/python-chart-150x112.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/python-chart-300x224.png 300w\" sizes=\"auto, (max-width: 608px) 100vw, 608px\" \/><\/a><p id=\"caption-attachment-22437\" class=\"wp-caption-text\">Titling the graph and labeling the axes<\/p><\/div>\n<\/div>\n<div class=\"Mu SP\"><strong><a href=\"https:\/\/data-flair.training\/blogs\/python-data-file-formats\/\" target=\"_blank\" rel=\"noopener\">Let&#8217;s Discuss Python Data File Formats \u2013 How to Read CSV, JSON, and XLS Files<\/a><\/strong><\/div>\n<h4 class=\"western\">b. Setting line color and type<\/h4>\n<p>To set the line color, you use a Unicode character in the parameter list-<\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.plot(x,y,'g')<\/pre>\n<p><strong>[&lt;matplotlib.lines.Line2D object at 0x045E6FF0&gt;]<\/strong><\/p>\n<div id=\"attachment_22243\" style=\"width: 582px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/linecolor.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-22243\" class=\"wp-image-22243 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/linecolor.png\" alt=\"Python Charts\" width=\"572\" height=\"428\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/linecolor.png 572w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/linecolor-150x112.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/linecolor-300x224.png 300w\" sizes=\"auto, (max-width: 572px) 100vw, 572px\" \/><\/a><p id=\"caption-attachment-22243\" class=\"wp-caption-text\">Setting line color and type<\/p><\/div>\n<p>Now to set the line type, we can-<\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.plot(x,y,'*')<\/pre>\n<p><strong>[&lt;matplotlib.lines.Line2D object at 0x0A0A4350&gt;]<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.show()<\/pre>\n<div id=\"attachment_22248\" style=\"width: 589px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/linetype.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-22248\" class=\"wp-image-22248 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/linetype.png\" alt=\"Python Charts\" width=\"579\" height=\"432\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/linetype.png 579w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/linetype-150x112.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/linetype-300x224.png 300w\" sizes=\"auto, (max-width: 579px) 100vw, 579px\" \/><\/a><p id=\"caption-attachment-22248\" class=\"wp-caption-text\">Setting line color and type<\/p><\/div>\n<p>Now, what if we wanted to set both at once?<\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.plot(x,y,'*g')<\/pre>\n<p><strong>[&lt;matplotlib.lines.Line2D object at 0x0A10B810&gt;]<\/strong><br \/>\n<strong><a href=\"https:\/\/data-flair.training\/blogs\/python-data-cleansing\/\" target=\"_blank\" rel=\"noopener\">Follow this link to know about Python Data Cleansing by Pandas &amp; Numpy<\/a><\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.show()<\/pre>\n<div id=\"attachment_22245\" style=\"width: 591px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/linecolorandtype-1.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-22245\" class=\"wp-image-22245 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/linecolorandtype-1.png\" alt=\"Python Charts\" width=\"581\" height=\"438\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/linecolorandtype-1.png 581w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/linecolorandtype-1-150x113.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/linecolorandtype-1-300x226.png 300w\" sizes=\"auto, (max-width: 581px) 100vw, 581px\" \/><\/a><p id=\"caption-attachment-22245\" class=\"wp-caption-text\">Charts in Python-\u00a0Setting line color and type<\/p><\/div>\n<p>\u2018g*\u2019 gives us the same output.<\/p>\n<h3 class=\"western\">Styling your Chart in Python<\/h3>\n<p>Apart from fiddling with the properties of your charts in Python, you can also style it in a few different ways. Let\u2019s see how.<\/p>\n<div id=\"attachment_22259\" style=\"width: 1210px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Styling-your-Python-Chart-01.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-22259\" class=\"wp-image-22259 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Styling-your-Python-Chart-01.jpg\" alt=\"Styling your Python Chart\" width=\"1200\" height=\"628\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Styling-your-Python-Chart-01.jpg 1200w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Styling-your-Python-Chart-01-150x79.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Styling-your-Python-Chart-01-300x157.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Styling-your-Python-Chart-01-768x402.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Styling-your-Python-Chart-01-1024x536.jpg 1024w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/a><p id=\"caption-attachment-22259\" class=\"wp-caption-text\">Styling your Python Chart<\/p><\/div>\n<h4 class=\"western\">a. Adding Annotations<\/h4>\n<p>It is possible to drop in a label in your charts in Python wherever you want.<\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; x=np.arange(0,7)\r\n&gt;&gt;&gt; y=sin(x)\r\n&gt;&gt;&gt; plt.plot(x,y)<\/pre>\n<p><strong>[&lt;matplotlib.lines.Line2D object at 0x076DCB90&gt;]<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.annotate(xy=[3.5,0],s='The curve') #You can add the annotations before plotting if you want<\/pre>\n<p><strong>Text(3.5,0,&#8217;The curve&#8217;)<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.show()<\/pre>\n<div id=\"attachment_22246\" style=\"width: 589px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/annotation-1.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-22246\" class=\"wp-image-22246 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/annotation-1.png\" alt=\"Python Charts\" width=\"579\" height=\"425\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/annotation-1.png 579w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/annotation-1-150x110.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/annotation-1-300x220.png 300w\" sizes=\"auto, (max-width: 579px) 100vw, 579px\" \/><\/a><p id=\"caption-attachment-22246\" class=\"wp-caption-text\">Styling your Chart-\u00a0Adding Annotations<\/p><\/div>\n<p><strong><a href=\"https:\/\/data-flair.training\/blogs\/python-file\/\" target=\"_blank\" rel=\"noopener\">Let&#8217;s Read about Python File I\/O \u2013 Python Write to File and Read File\u00a0<\/a><\/strong><\/p>\n<h4>b. Adding Legends<\/h4>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; x=np.arange(0,7)\r\n&gt;&gt;&gt; y=sin(x)\r\n&gt;&gt;&gt; z=np.cos(x)\r\n&gt;&gt;&gt; plt.plot(x,y)<\/pre>\n<p><strong>[&lt;matplotlib.lines.Line2D object at 0x07D24530&gt;]<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.plot(x,z)<\/pre>\n<p><strong>[&lt;matplotlib.lines.Line2D object at 0x07D248F0&gt;]<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.legend(['Sine','Cosine'],loc=3)<\/pre>\n<p><strong>&lt;matplotlib.legend.Legend object at 0x07D249D0&gt;<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.show()<\/pre>\n<div id=\"attachment_22249\" style=\"width: 595px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/legends.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-22249\" class=\"wp-image-22249 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/legends.png\" alt=\"Python Charts\" width=\"585\" height=\"416\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/legends.png 585w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/legends-150x107.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/legends-300x213.png 300w\" sizes=\"auto, (max-width: 585px) 100vw, 585px\" \/><\/a><p id=\"caption-attachment-22249\" class=\"wp-caption-text\">Styling your Chart &#8211; Adding Legends<\/p><\/div>\n<h3 class=\"western\">How to Save Python Charts File?<\/h3>\n<p>Finally, let\u2019s see what you can do when you want to save a Python chart you\u2019ve just created.<\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.scatter(x,y,s=z*3001,marker='*',color='pink')<\/pre>\n<p><strong>&lt;matplotlib.collections.PathCollection object at 0x07D402F0&gt;<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.savefig('pinkstars.pdf',format='pdf')<\/pre>\n<div id=\"attachment_22250\" style=\"width: 662px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/pdf.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-22250\" class=\"wp-image-22250 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/pdf.png\" alt=\"Python Charts\" width=\"652\" height=\"506\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/pdf.png 652w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/pdf-150x116.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/pdf-300x233.png 300w\" sizes=\"auto, (max-width: 652px) 100vw, 652px\" \/><\/a><p id=\"caption-attachment-22250\" class=\"wp-caption-text\">Python Charts File<\/p><\/div>\n<p>How to Save Python Charts File. Now we want to save this as a PNG. There is no need to make another call to plot(); simply save it.<br \/>\n<strong><a href=\"https:\/\/data-flair.training\/blogs\/python-multiple-inheritance\/\" target=\"_blank\" rel=\"noopener\">Do you know about Python Multiple Inheritance \u2013 Python MRO\u00a0<\/a><\/strong><\/p>\n<div id=\"attachment_22251\" style=\"width: 710px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/png.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-22251\" class=\"wp-image-22251 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/png.png\" alt=\"Python Charts\" width=\"700\" height=\"476\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/png.png 700w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/png-150x102.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/png-300x204.png 300w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/a><p id=\"caption-attachment-22251\" class=\"wp-caption-text\">Saving Python Charts File<\/p><\/div>\n<p>So, this was all about Python Charts Tutorial. Hope you like our explanation.<\/p>\n<h3 class=\"western\">Conclusion<\/h3>\n<p>Hence, with this, we sum up our Python Charts tutorial on bubble charts and 3D charts in Python. Now you also know how to style Charts in Python, to make them aesthetically better and also aid understanding.<\/p>\n<p>Using bubble and 3D charts can enhance your data storytelling by making complex relationships easier to understand. They help identify trends that may not be visible in 2D plots. However, it&#8217;s important to use them wisely, as they can become cluttered if the dataset is too large or the bubble sizes vary too much. With good design and labeling, these charts can add great value to presentations and dashboards.<\/p>\n<p>Are there any more topics you would like us to write on? Let us know in the comments below.<br \/>\nRelated Topic &#8211;<strong><a href=\"https:\/\/data-flair.training\/blogs\/python-generator-vs-iterator\/\">\u00a0Python Generator vs Iterator\u00a0<\/a><\/strong><br \/>\n<strong><a href=\"https:\/\/en.wikipedia.org\/wiki\/Matplotlib\">For reference<\/a><\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In our last tutorial, we studied the Python Array Module. Today, we will take a quick look at Python Charts. Here, we will cover the Python Bubble Charts and 3D charts in Python. Then,&#46;&#46;&#46;<\/p>\n","protected":false},"author":5,"featured_media":22451,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[46],"tags":[134,2181,2481,2482,6315,10350,10351,10394,10395,10411,10412,10567,12384,13955],"class_list":["post-22224","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","tag-3d-charts-in-python","tag-bubble-charts-in-python","tag-charts-in-python","tag-charts-properties-in-python","tag-how-to-save-python-charts-file","tag-python-3d-charts","tag-python-3d-scatterplots","tag-python-bubble-charts","tag-python-bubble-plot","tag-python-charts","tag-python-charts-properties","tag-python-graph","tag-saving-python-charts-file","tag-styling-your-python-chart"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Python Charts - Bubble, 3D Charts with Properties of Chart - DataFlair<\/title>\n<meta name=\"description\" content=\"Learn Python Bubble Chart and Python 3D Chart with Properties. See how to Style Python charts, Saving Charts in python, Color bubble chart\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/python-charts\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python Charts - Bubble, 3D Charts with Properties of Chart - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Learn Python Bubble Chart and Python 3D Chart with Properties. See how to Style Python charts, Saving Charts in python, Color bubble chart\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/python-charts\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2018-07-22T03:15:10+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-04-29T10:49:55+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Python-Charts-01-1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Python Charts - Bubble, 3D Charts with Properties of Chart - DataFlair","description":"Learn Python Bubble Chart and Python 3D Chart with Properties. See how to Style Python charts, Saving Charts in python, Color bubble chart","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/data-flair.training\/blogs\/python-charts\/","og_locale":"en_US","og_type":"article","og_title":"Python Charts - Bubble, 3D Charts with Properties of Chart - DataFlair","og_description":"Learn Python Bubble Chart and Python 3D Chart with Properties. See how to Style Python charts, Saving Charts in python, Color bubble chart","og_url":"https:\/\/data-flair.training\/blogs\/python-charts\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2018-07-22T03:15:10+00:00","article_modified_time":"2026-04-29T10:49:55+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Python-Charts-01-1.jpg","type":"image\/jpeg"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/python-charts\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/python-charts\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/7f83c342f5d1632d6f7b4b0b0f447823"},"headline":"Python Charts &#8211; Bubble, 3D Charts with Properties of Chart","datePublished":"2018-07-22T03:15:10+00:00","dateModified":"2026-04-29T10:49:55+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/python-charts\/"},"wordCount":1234,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/python-charts\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Python-Charts-01-1.jpg","keywords":["3D Charts In python","Bubble Charts in Python","Charts in Python '","Charts Properties in Python","How to Save Python Charts File","Python 3D Charts","Python 3D Scatterplots","Python Bubble Charts","Python Bubble Plot","Python Charts","Python Charts Properties","Python Graph","Saving Python Charts File","Styling your Python Chart"],"articleSection":["Python Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/python-charts\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/python-charts\/","url":"https:\/\/data-flair.training\/blogs\/python-charts\/","name":"Python Charts - Bubble, 3D Charts with Properties of Chart - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/python-charts\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/python-charts\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Python-Charts-01-1.jpg","datePublished":"2018-07-22T03:15:10+00:00","dateModified":"2026-04-29T10:49:55+00:00","description":"Learn Python Bubble Chart and Python 3D Chart with Properties. See how to Style Python charts, Saving Charts in python, Color bubble chart","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/python-charts\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/python-charts\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/python-charts\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Python-Charts-01-1.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Python-Charts-01-1.jpg","width":1200,"height":628,"caption":"Python Charts - Bubble, 3D Charts with Properties of Chart"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/python-charts\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Python Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/python\/"},{"@type":"ListItem","position":3,"name":"Python Charts &#8211; Bubble, 3D Charts with Properties of Chart"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/7f83c342f5d1632d6f7b4b0b0f447823","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"DataFlair Team creates expert-level guides on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our goal is to empower learners with easy-to-understand content. Explore our resources for career growth and practical learning.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam1\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/22224","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=22224"}],"version-history":[{"count":9,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/22224\/revisions"}],"predecessor-version":[{"id":148121,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/22224\/revisions\/148121"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/22451"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=22224"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=22224"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=22224"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}