

{"id":129313,"date":"2024-01-09T16:19:17","date_gmt":"2024-01-09T10:49:17","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=129313"},"modified":"2024-01-09T16:19:17","modified_gmt":"2024-01-09T10:49:17","slug":"python-matplotlib-program-for-subplot","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/python-matplotlib-program-for-subplot\/","title":{"rendered":"Python Matplotlib Program for Subplot"},"content":{"rendered":"<h3>Program 1<\/h3>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import matplotlib.pyplot as mat\r\nx=[0,1,2,3,4,5]\r\ny=[0,1,4,9,16,25]\r\nx1=[0,10,20,30,40,50]\r\ny1=[0,20,10,40,10,50]\r\nx2=[0,10,20,30,40,50]\r\ny2=[0,20,10,40,10,50]\r\nx3=[0,10,20,30,40,50]\r\ny4=[0,20,10,40,10,50]\r\nmat.subplot(3,2,1)\r\nmat.plot(x,y,marker='.',mfc='r',mec='k',ms=10)\r\nmat.subplot(3,2,2)\r\nmat.plot(x1,y1,marker='.',mfc='y',mec='r',ms=10)\r\nmat.subplot(3,2,3)\r\nmat.plot(x2,y1,marker='.',mfc='y',mec='r',ms=10)\r\nmat.subplot(3,2,4)\r\nmat.plot(x3,y4,marker='.',mfc='y',mec='r',ms=10)\r\n\r\n\r\nmat.title(\"Line Chart of SubPlot\")\r\nmat.xlabel(\"X-Axis\")\r\nmat.ylabel(\"Y-Axis\")\r\nmat.show()<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Program 1 import matplotlib.pyplot as mat x=[0,1,2,3,4,5] y=[0,1,4,9,16,25] x1=[0,10,20,30,40,50] y1=[0,20,10,40,10,50] x2=[0,10,20,30,40,50] y2=[0,20,10,40,10,50] x3=[0,10,20,30,40,50] y4=[0,20,10,40,10,50] mat.subplot(3,2,1) mat.plot(x,y,marker=&#8217;.&#8217;,mfc=&#8217;r&#8217;,mec=&#8217;k&#8217;,ms=10) mat.subplot(3,2,2) mat.plot(x1,y1,marker=&#8217;.&#8217;,mfc=&#8217;y&#8217;,mec=&#8217;r&#8217;,ms=10) mat.subplot(3,2,3) mat.plot(x2,y1,marker=&#8217;.&#8217;,mfc=&#8217;y&#8217;,mec=&#8217;r&#8217;,ms=10) mat.subplot(3,2,4) mat.plot(x3,y4,marker=&#8217;.&#8217;,mfc=&#8217;y&#8217;,mec=&#8217;r&#8217;,ms=10) mat.title(&#8220;Line Chart of SubPlot&#8221;) mat.xlabel(&#8220;X-Axis&#8221;) mat.ylabel(&#8220;Y-Axis&#8221;) mat.show() &nbsp;<\/p>\n","protected":false},"author":86671,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27777],"tags":[8601,30289,30286,30304,30303,30302],"class_list":["post-129313","post","type-post","status-publish","format-standard","hentry","category-matplotlib-tutorials","tag-matplotlib","tag-matplotlib-practical","tag-matplotlib-program","tag-matplotlib-program-for-subplot","tag-matplotlib-subplot","tag-subplot-in-matplotlib"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Python Matplotlib Program for Subplot - DataFlair<\/title>\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-matplotlib-program-for-subplot\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python Matplotlib Program for Subplot - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Program 1 import matplotlib.pyplot as mat x=[0,1,2,3,4,5] y=[0,1,4,9,16,25] x1=[0,10,20,30,40,50] y1=[0,20,10,40,10,50] x2=[0,10,20,30,40,50] y2=[0,20,10,40,10,50] x3=[0,10,20,30,40,50] y4=[0,20,10,40,10,50] mat.subplot(3,2,1) mat.plot(x,y,marker=&#039;.&#039;,mfc=&#039;r&#039;,mec=&#039;k&#039;,ms=10) mat.subplot(3,2,2) mat.plot(x1,y1,marker=&#039;.&#039;,mfc=&#039;y&#039;,mec=&#039;r&#039;,ms=10) mat.subplot(3,2,3) mat.plot(x2,y1,marker=&#039;.&#039;,mfc=&#039;y&#039;,mec=&#039;r&#039;,ms=10) mat.subplot(3,2,4) mat.plot(x3,y4,marker=&#039;.&#039;,mfc=&#039;y&#039;,mec=&#039;r&#039;,ms=10) mat.title(&quot;Line Chart of SubPlot&quot;) mat.xlabel(&quot;X-Axis&quot;) mat.ylabel(&quot;Y-Axis&quot;) mat.show() &nbsp;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/python-matplotlib-program-for-subplot\/\" \/>\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=\"2024-01-09T10:49:17+00:00\" \/>\n<meta name=\"author\" content=\"TechVidvan 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=\"TechVidvan Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Python Matplotlib Program for Subplot - DataFlair","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-matplotlib-program-for-subplot\/","og_locale":"en_US","og_type":"article","og_title":"Python Matplotlib Program for Subplot - DataFlair","og_description":"Program 1 import matplotlib.pyplot as mat x=[0,1,2,3,4,5] y=[0,1,4,9,16,25] x1=[0,10,20,30,40,50] y1=[0,20,10,40,10,50] x2=[0,10,20,30,40,50] y2=[0,20,10,40,10,50] x3=[0,10,20,30,40,50] y4=[0,20,10,40,10,50] mat.subplot(3,2,1) mat.plot(x,y,marker='.',mfc='r',mec='k',ms=10) mat.subplot(3,2,2) mat.plot(x1,y1,marker='.',mfc='y',mec='r',ms=10) mat.subplot(3,2,3) mat.plot(x2,y1,marker='.',mfc='y',mec='r',ms=10) mat.subplot(3,2,4) mat.plot(x3,y4,marker='.',mfc='y',mec='r',ms=10) mat.title(\"Line Chart of SubPlot\") mat.xlabel(\"X-Axis\") mat.ylabel(\"Y-Axis\") mat.show() &nbsp;","og_url":"https:\/\/data-flair.training\/blogs\/python-matplotlib-program-for-subplot\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2024-01-09T10:49:17+00:00","author":"TechVidvan Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"TechVidvan Team","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/python-matplotlib-program-for-subplot\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/python-matplotlib-program-for-subplot\/"},"author":{"name":"TechVidvan Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/0e594f928e31fc96628ac40f6ae74f49"},"headline":"Python Matplotlib Program for Subplot","datePublished":"2024-01-09T10:49:17+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/python-matplotlib-program-for-subplot\/"},"wordCount":7,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"keywords":["Matplotlib","matplotlib practical","matplotlib program","matplotlib program for subplot","matplotlib subplot","subplot in matplotlib"],"articleSection":["Matplotlib Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/python-matplotlib-program-for-subplot\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/python-matplotlib-program-for-subplot\/","url":"https:\/\/data-flair.training\/blogs\/python-matplotlib-program-for-subplot\/","name":"Python Matplotlib Program for Subplot - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"datePublished":"2024-01-09T10:49:17+00:00","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/python-matplotlib-program-for-subplot\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/python-matplotlib-program-for-subplot\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/python-matplotlib-program-for-subplot\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Matplotlib Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/matplotlib-tutorials\/"},{"@type":"ListItem","position":3,"name":"Python Matplotlib Program for Subplot"}]},{"@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\/0e594f928e31fc96628ac40f6ae74f49","name":"TechVidvan Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/c89190da3d4010c71ba476b618ab10fdc2335c82cdfa0ad5002d98d0f2473444?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/c89190da3d4010c71ba476b618ab10fdc2335c82cdfa0ad5002d98d0f2473444?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c89190da3d4010c71ba476b618ab10fdc2335c82cdfa0ad5002d98d0f2473444?s=96&d=mm&r=g","caption":"TechVidvan Team"},"description":"TechVidvan Team provides high-quality content &amp; courses on AI, ML, Data Science, Data Engineering, Data Analytics, programming, Python, DSA, Android, Flutter, full stack web dev, MERN, and many latest technology.","url":"https:\/\/data-flair.training\/blogs\/author\/test001\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/129313","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\/86671"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=129313"}],"version-history":[{"count":6,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/129313\/revisions"}],"predecessor-version":[{"id":132955,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/129313\/revisions\/132955"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=129313"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=129313"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=129313"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}