

{"id":145298,"date":"2025-06-13T11:51:27","date_gmt":"2025-06-13T06:21:27","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=145298"},"modified":"2025-06-13T11:51:27","modified_gmt":"2025-06-13T06:21:27","slug":"how-to-change-font-of-title-in-matplotlib","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/how-to-change-font-of-title-in-matplotlib\/","title":{"rendered":"How to Change Font of Title in Matplotlib"},"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=[i**2 for i in x]\r\nmat.plot(x,y,marker='.',mfc='y',mec='k',ms=10,ls=\"dotted\",lw=2,c='r')\r\n\r\nfc={'family':'Times New Roman','size':20,'color':'r'}\r\n\r\nfc1={'family':'Times New Roman','size':25,'color':'g'}\r\nfc2={'family':'Verdana','size':30,'color':'b'}\r\nmat.xlabel(\"X-Axis\",fontdict=fc)\r\nmat.ylabel(\"Y-Axis\",fontdict=fc)\r\nmat.title(\"Line Chart\",fontdict=fc2)\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=[i**2 for i in x] mat.plot(x,y,marker=&#8217;.&#8217;,mfc=&#8217;y&#8217;,mec=&#8217;k&#8217;,ms=10,ls=&#8221;dotted&#8221;,lw=2,c=&#8217;r&#8217;) fc={&#8216;family&#8217;:&#8217;Times New Roman&#8217;,&#8217;size&#8217;:20,&#8217;color&#8217;:&#8217;r&#8217;} fc1={&#8216;family&#8217;:&#8217;Times New Roman&#8217;,&#8217;size&#8217;:25,&#8217;color&#8217;:&#8217;g&#8217;} fc2={&#8216;family&#8217;:&#8217;Verdana&#8217;,&#8217;size&#8217;:30,&#8217;color&#8217;:&#8217;b&#8217;} mat.xlabel(&#8220;X-Axis&#8221;,fontdict=fc) mat.ylabel(&#8220;Y-Axis&#8221;,fontdict=fc) mat.title(&#8220;Line Chart&#8221;,fontdict=fc2) mat.show() &nbsp;<\/p>\n","protected":false},"author":581,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27777],"tags":[34386,34387,34385,8601,30289,30286],"class_list":["post-145298","post","type-post","status-publish","format-standard","hentry","category-matplotlib-tutorials","tag-change-font-of-title-in-matplotlib","tag-changing-font-of-title-in-matplotlib","tag-how-to-change-font-of-title-in-matplotlib","tag-matplotlib","tag-matplotlib-practical","tag-matplotlib-program"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Change Font of Title in Matplotlib - 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\/how-to-change-font-of-title-in-matplotlib\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Change Font of Title in Matplotlib - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Program 1 import matplotlib.pyplot as mat x=[0,1,2,3,4,5] y=[i**2 for i in x] mat.plot(x,y,marker=&#039;.&#039;,mfc=&#039;y&#039;,mec=&#039;k&#039;,ms=10,ls=&quot;dotted&quot;,lw=2,c=&#039;r&#039;) fc={&#039;family&#039;:&#039;Times New Roman&#039;,&#039;size&#039;:20,&#039;color&#039;:&#039;r&#039;} fc1={&#039;family&#039;:&#039;Times New Roman&#039;,&#039;size&#039;:25,&#039;color&#039;:&#039;g&#039;} fc2={&#039;family&#039;:&#039;Verdana&#039;,&#039;size&#039;:30,&#039;color&#039;:&#039;b&#039;} mat.xlabel(&quot;X-Axis&quot;,fontdict=fc) mat.ylabel(&quot;Y-Axis&quot;,fontdict=fc) mat.title(&quot;Line Chart&quot;,fontdict=fc2) mat.show() &nbsp;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/how-to-change-font-of-title-in-matplotlib\/\" \/>\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=\"2025-06-13T06:21:27+00:00\" \/>\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=\"1 minute\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Change Font of Title in Matplotlib - 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\/how-to-change-font-of-title-in-matplotlib\/","og_locale":"en_US","og_type":"article","og_title":"How to Change Font of Title in Matplotlib - DataFlair","og_description":"Program 1 import matplotlib.pyplot as mat x=[0,1,2,3,4,5] y=[i**2 for i in x] mat.plot(x,y,marker='.',mfc='y',mec='k',ms=10,ls=\"dotted\",lw=2,c='r') fc={'family':'Times New Roman','size':20,'color':'r'} fc1={'family':'Times New Roman','size':25,'color':'g'} fc2={'family':'Verdana','size':30,'color':'b'} mat.xlabel(\"X-Axis\",fontdict=fc) mat.ylabel(\"Y-Axis\",fontdict=fc) mat.title(\"Line Chart\",fontdict=fc2) mat.show() &nbsp;","og_url":"https:\/\/data-flair.training\/blogs\/how-to-change-font-of-title-in-matplotlib\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2025-06-13T06:21:27+00:00","author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/how-to-change-font-of-title-in-matplotlib\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/how-to-change-font-of-title-in-matplotlib\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/c187795dc82ab948373cca526df7c445"},"headline":"How to Change Font of Title in Matplotlib","datePublished":"2025-06-13T06:21:27+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/how-to-change-font-of-title-in-matplotlib\/"},"wordCount":10,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"keywords":["change font of title in matplotlib","changing font of title in matplotlib","how to change font of title in matplotlib","Matplotlib","matplotlib practical","matplotlib program"],"articleSection":["Matplotlib Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/how-to-change-font-of-title-in-matplotlib\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/how-to-change-font-of-title-in-matplotlib\/","url":"https:\/\/data-flair.training\/blogs\/how-to-change-font-of-title-in-matplotlib\/","name":"How to Change Font of Title in Matplotlib - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"datePublished":"2025-06-13T06:21:27+00:00","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/how-to-change-font-of-title-in-matplotlib\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/how-to-change-font-of-title-in-matplotlib\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/how-to-change-font-of-title-in-matplotlib\/#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":"How to Change Font of Title in Matplotlib"}]},{"@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\/c187795dc82ab948373cca526df7c445","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/2302ebc438084d2f1f993edc1996a0aae01332e81f3227cba8df0c48ec010ca4?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/2302ebc438084d2f1f993edc1996a0aae01332e81f3227cba8df0c48ec010ca4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2302ebc438084d2f1f993edc1996a0aae01332e81f3227cba8df0c48ec010ca4?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"DataFlair Team provides high-impact content on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. We make complex concepts easy to grasp, helping learners of all levels succeed in their tech careers.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam6\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/145298","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\/581"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=145298"}],"version-history":[{"count":2,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/145298\/revisions"}],"predecessor-version":[{"id":145308,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/145298\/revisions\/145308"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=145298"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=145298"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=145298"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}