{"id":9310,"date":"2021-02-20T18:27:51","date_gmt":"2021-02-20T12:57:51","guid":{"rendered":"https:\/\/web.archive.org\/web\/20240926031316\/https:\/\/www.pythonpool.com\/?p=9310"},"modified":"2024-01-01T10:55:00","modified_gmt":"2024-01-01T05:25:00","slug":"matplotlib-background-color","status":"publish","type":"post","link":"https:\/\/web.archive.org\/web\/20240926031316\/https:\/\/www.pythonpool.com\/matplotlib-background-color\/","title":{"rendered":"Change Matplotlib Background Color With Examples"},"content":{"rendered":"\n<p>Hello geeks!! In this article, we will learn about the matplotlib background color. We will see the different ways to change or modify the background color of a matplotlib graph. So, without wasting any time, let us get into the topic.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_65 counter-hierarchy ez-toc-counter ez-toc-transparent ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title \" >Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #990303;color:#990303\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #990303;color:#990303\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 eztoc-toggle-hide-by-default' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.pythonpool.com\/matplotlib-background-color\/#Prerequisites_for_changing_background_color\" title=\"Prerequisites for changing background color:\">Prerequisites for changing background color:<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.pythonpool.com\/matplotlib-background-color\/#Approach_for_changing_the_background_color\" title=\"Approach for changing the background color:\">Approach for changing the background color:<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.pythonpool.com\/matplotlib-background-color\/#Illustrated_Example\" title=\"Illustrated Example:\">Illustrated Example:<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.pythonpool.com\/matplotlib-background-color\/#Example_3_Setting_Outer_and_Inner_color_of_the_plot\" title=\"Example 3: Setting Outer and Inner color of the plot\">Example 3: Setting Outer and Inner color of the plot<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.pythonpool.com\/matplotlib-background-color\/#Conclusion\" title=\"Conclusion:\">Conclusion:<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\" id=\"h-prerequisites-for-changing-background-color\"><span class=\"ez-toc-section\" id=\"Prerequisites_for_changing_background_color\"><\/span>Prerequisites for changing background color:<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul>\n<li><a href=\"https:\/\/en.wikipedia.org\/wiki\/Matplotlib\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Matplotlib<\/strong><\/a> &#8211; Matplotlib is a plotting library used in the Python library with NumPy as an extension.<\/li>\n\n\n\n<li>NumPy &#8211; It is a Python library that is used to work with an array. It can also work for linear algebra, Fourier transform, and matrices.<\/li>\n<\/ul>\n\n\n\n<p>The figure below shows that the plot comprises the X-axis, Y-axis, plot title, and axes. The background color of the plot is white by default. If we have to change the plot&#8217;s background color to <a href=\"https:\/\/www.pythonpool.com\/matplotlib-figsize\/\" target=\"_blank\" rel=\"noreferrer noopener\">make it look more attractive<\/a>, we have to make axes object axes() after plotting the graph.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/upload.wikimedia.org\/wikipedia\/commons\/thumb\/0\/07\/Synchrotron_Functions.svg\/270px-Synchrotron_Functions.svg.png\" alt=\"Approach for changing the matplotlib background color\"\/><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"h-approach-for-changing-the-background-color\"><span class=\"ez-toc-section\" id=\"Approach_for_changing_the_background_color\"><\/span>Approach for changing the background color:<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul>\n<li>At first, we have to import the respective module<\/li>\n\n\n\n<li>Secondly, we have to load or create data<\/li>\n\n\n\n<li>Next, we have to plot a regular graph<\/li>\n\n\n\n<li>Then, create an axes object<\/li>\n\n\n\n<li>Finally, set an attribute as a set_facecolor() to the required color. It could accept both the color code and the name of the color.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-syntax\">Syntax:<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>Axes.set_facecolor(self,\u00a0color)<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-parameters\">Parameters:<\/h4>\n\n\n\n<ul>\n<li><strong>color:<\/strong> The color of the background<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-illustrated-example\"><span class=\"ez-toc-section\" id=\"Illustrated_Example\"><\/span>Illustrated Example:<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>So now let us understand with suitable example:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-example-1-matplotlib-graph-with-default-background\">Example 1: Matplotlib graph with default background<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport matplotlib.pyplot as plt \nMarks = &#x5B;50, 60, 70, 80, 90] \nGrade = &#x5B;'B', 'B', 'B+', 'B+', 'A'] \nplt.plot(student_marks, student_grade) \nplt.xlabel(&quot;Marks&quot;, fontweight='bold') \nplt.ylabel(&quot;Grade&quot;, fontweight='bold') \nplt.show() \n<\/pre><\/div>\n\n\n<p> <\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"385\" height=\"262\" src=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/02\/image-44.png\" alt=\"Matplotlib Graph With Default Background\" class=\"wp-image-9311\" srcset=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/02\/image-44.png 385w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/02\/image-44-300x204.png 300w\" sizes=\"(max-width: 385px) 100vw, 385px\" \/><\/figure><\/div>\n\n\n<ul>\n<li>According to the above example, we can see that we have imported library matplotlib to plot the graph.<\/li>\n\n\n\n<li>Next, we have declared two lists,&#8217; Marks&#8217; and &#8216;grade,&#8217; and assigned them with certain values accordingly.<\/li>\n\n\n\n<li>Then we used the plot() method to plot the graph with the given parameter. <\/li>\n\n\n\n<li>We then use xlebel and ylebel to lebel X and Y-axis, respectively.<\/li>\n\n\n\n<li>And finally, we have used the show() method to display the corresponding graph.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-example-2-matplotlib-graph-with-custom-background\">Example 2: Matplotlib graph with Custom background:<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport matplotlib.pyplot as plt \nMarks = &#x5B;50, 60, 70, 80, 90] \nGrade = &#x5B;'B', 'B', 'B+', 'B+', 'A'] \nplt.plot(Marks,Grade) \nplt.xlabel(&quot;Marks&quot;, fontweight='bold') \n\nplt.ylabel(&quot;Grade&quot;, fontweight='bold') \nax = plt.axes() \nax.set_facecolor(&quot;#99c2ff&quot;) \nplt.show() \n<\/pre><\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"385\" height=\"262\" src=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/02\/image-45.png\" alt=\"Matplotlib Graph With Custom Background\" class=\"wp-image-9312\" srcset=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/02\/image-45.png 385w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/02\/image-45-300x204.png 300w\" sizes=\"(max-width: 385px) 100vw, 385px\" \/><\/figure><\/div>\n\n\n<p>In this example, we have the same steps are the previous example. The only difference is that we have used the axes() method object to change the figure&#8217;s background color using the facecolor() method.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-example-3-setting-outer-and-inner-color-of-the-plot\"><span class=\"ez-toc-section\" id=\"Example_3_Setting_Outer_and_Inner_color_of_the_plot\"><\/span>Example 3: <strong>Setting Outer and Inner color of the plot<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport matplotlib.pyplot as plt \nMarks = &#x5B;50, 60, 70, 80, 90] \nGrade = &#x5B;'B', 'B', 'B+', 'B+', 'A'] \n\n \nplt.figure(facecolor='#008060') \nplt.plot(Marks,Grade) \nplt.xlabel(&quot;Marks&quot;, fontweight='bold')\nplt.ylabel(&quot;Grade&quot;, fontweight='bold') \nax = plt.axes() \nax.set_facecolor(&quot;#99c2ff&quot;) \nplt.show() \n\n<\/pre><\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"385\" height=\"262\" src=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/02\/image-46.png\" alt=\"Setting Outer and Inner color of plot\" class=\"wp-image-9313\" srcset=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/02\/image-46.png 385w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/02\/image-46-300x204.png 300w\" sizes=\"(max-width: 385px) 100vw, 385px\" \/><\/figure><\/div>\n\n\n<p>As you can see, in this example, we have set both an <a href=\"https:\/\/www.pythonpool.com\/numpy-outer\/\" target=\"_blank\" rel=\"noopener\">outer<\/a> color and an inner color as a background color of our plot.  We have used the &#8216;facecolor&#8217; attribute of &#8216;plt.figure()&#8217;  to set the background color of the plot&#8217;s outer area. And then, like the previous example, we used the set_face<a href=\"https:\/\/www.pythonpool.com\/python-colorama\/\" target=\"_blank\" rel=\"noopener\">color<\/a>() method of the axes() object to set the background color of the plot.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-conclusion\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion:<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>With this, we come to an end with this article. These are the various ways to change the background color in matplotlib. I hope that you were able to gain some knowledge from this article.<\/p>\n\n\n\n<p>However, if you have any doubts or questions, do let me know in the comment section below. I will try to help you as soon as possible.<\/p>\n\n\n\n<p><strong><em>Happy Pythoning!<\/em><\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello geeks!! In this article, we will learn about the matplotlib background color. We will see the different ways to change or modify the background &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"Change Matplotlib Background Color With Examples\" class=\"read-more button\" href=\"https:\/\/www.pythonpool.com\/matplotlib-background-color\/#more-9310\" aria-label=\"More on Change Matplotlib Background Color With Examples\">Read more<\/a><\/p>\n","protected":false},"author":12,"featured_media":9359,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[2071],"tags":[3637,3639,3638,3636],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v20.1 (Yoast SEO v22.4) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Change Matplotlib Background Color With Examples - Python Pool<\/title>\n<meta name=\"description\" content=\"matplotlib background color can be changed using the set_facecolor() method of an axes() object in Python. In this article, we will learn\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.pythonpool.com.dream.website\/matplotlib-background-color\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Change Matplotlib Background Color With Examples\" \/>\n<meta property=\"og:description\" content=\"Hello geeks!! In this article, we will learn about the matplotlib background color. We will see the different ways to change or modify the background\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pythonpool.com.dream.website\/matplotlib-background-color\/\" \/>\n<meta property=\"og:site_name\" content=\"Python Pool\" \/>\n<meta property=\"article:published_time\" content=\"2021-02-20T12:57:51+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-01-01T05:25:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.pythonpool.com.dream.website\/wp-content\/uploads\/2021\/02\/Change-Matplotlib-Background-Color-With-Examples.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1350\" \/>\n\t<meta property=\"og:image:height\" content=\"650\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Prachee Sao\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@pythonpool\" \/>\n<meta name=\"twitter:site\" content=\"@pythonpool\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Prachee Sao\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.pythonpool.com.dream.website\/matplotlib-background-color\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.pythonpool.com.dream.website\/matplotlib-background-color\/\"},\"author\":{\"name\":\"Prachee Sao\",\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/person\/b91d749826b21e606d55cda77d51ef47\"},\"headline\":\"Change Matplotlib Background Color With Examples\",\"datePublished\":\"2021-02-20T12:57:51+00:00\",\"dateModified\":\"2024-01-01T05:25:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.pythonpool.com.dream.website\/matplotlib-background-color\/\"},\"wordCount\":489,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.pythonpool.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.pythonpool.com.dream.website\/matplotlib-background-color\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/02\/Change-Matplotlib-Background-Color-With-Examples.png\",\"keywords\":[\"matplotlib change background color\",\"matplotlib legend background color\",\"matplotlib plot background color\",\"matplotlib set background color\"],\"articleSection\":[\"Matplotlib\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.pythonpool.com.dream.website\/matplotlib-background-color\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.pythonpool.com.dream.website\/matplotlib-background-color\/\",\"url\":\"https:\/\/www.pythonpool.com.dream.website\/matplotlib-background-color\/\",\"name\":\"Change Matplotlib Background Color With Examples - Python Pool\",\"isPartOf\":{\"@id\":\"https:\/\/www.pythonpool.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.pythonpool.com.dream.website\/matplotlib-background-color\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.pythonpool.com.dream.website\/matplotlib-background-color\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/02\/Change-Matplotlib-Background-Color-With-Examples.png\",\"datePublished\":\"2021-02-20T12:57:51+00:00\",\"dateModified\":\"2024-01-01T05:25:00+00:00\",\"description\":\"matplotlib background color can be changed using the set_facecolor() method of an axes() object in Python. In this article, we will learn\",\"breadcrumb\":{\"@id\":\"https:\/\/www.pythonpool.com.dream.website\/matplotlib-background-color\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.pythonpool.com.dream.website\/matplotlib-background-color\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.pythonpool.com.dream.website\/matplotlib-background-color\/#primaryimage\",\"url\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/02\/Change-Matplotlib-Background-Color-With-Examples.png\",\"contentUrl\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/02\/Change-Matplotlib-Background-Color-With-Examples.png\",\"width\":1350,\"height\":650,\"caption\":\"matplotlib background color\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.pythonpool.com.dream.website\/matplotlib-background-color\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.pythonpool.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Change Matplotlib Background Color With Examples\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.pythonpool.com\/#website\",\"url\":\"https:\/\/www.pythonpool.com\/\",\"name\":\"Python Pool\",\"description\":\"Your One-Stop Python Learning Destination\",\"publisher\":{\"@id\":\"https:\/\/www.pythonpool.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.pythonpool.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.pythonpool.com\/#organization\",\"name\":\"Python Pool\",\"url\":\"https:\/\/www.pythonpool.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/aa.png\",\"contentUrl\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/aa.png\",\"width\":452,\"height\":185,\"caption\":\"Python Pool\"},\"image\":{\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/twitter.com\/pythonpool\",\"https:\/\/www.youtube.com\/c\/pythonpool\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/person\/b91d749826b21e606d55cda77d51ef47\",\"name\":\"Prachee Sao\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/969eb9ba38e0aa5c3175935da2455ac7?s=96&d=wavatar&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/969eb9ba38e0aa5c3175935da2455ac7?s=96&d=wavatar&r=g\",\"caption\":\"Prachee Sao\"}}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Change Matplotlib Background Color With Examples - Python Pool","description":"matplotlib background color can be changed using the set_facecolor() method of an axes() object in Python. In this article, we will learn","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:\/\/web.archive.org\/web\/20240926031316\/https:\/\/www.pythonpool.com.dream.website\/matplotlib-background-color\/","og_locale":"en_US","og_type":"article","og_title":"Change Matplotlib Background Color With Examples","og_description":"Hello geeks!! In this article, we will learn about the matplotlib background color. We will see the different ways to change or modify the background","og_url":"https:\/\/web.archive.org\/web\/20240926031316\/https:\/\/www.pythonpool.com.dream.website\/matplotlib-background-color\/","og_site_name":"Python Pool","article_published_time":"2021-02-20T12:57:51+00:00","article_modified_time":"2024-01-01T05:25:00+00:00","og_image":[{"width":1350,"height":650,"url":"https:\/\/web.archive.org\/web\/20240926031316\/https:\/\/www.pythonpool.com.dream.website\/wp-content\/uploads\/2021\/02\/Change-Matplotlib-Background-Color-With-Examples.png","type":"image\/png"}],"author":"Prachee Sao","twitter_card":"summary_large_image","twitter_creator":"@pythonpool","twitter_site":"@pythonpool","twitter_misc":{"Written by":"Prachee Sao","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/web.archive.org\/web\/20240926031316\/https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/web.archive.org\/web\/20240926031316\/https:\/\/www.pythonpool.com.dream.website\/matplotlib-background-color\/#article","isPartOf":{"@id":"https:\/\/web.archive.org\/web\/20240926031316\/https:\/\/www.pythonpool.com.dream.website\/matplotlib-background-color\/"},"author":{"name":"Prachee Sao","@id":"https:\/\/web.archive.org\/web\/20240926031316\/https:\/\/www.pythonpool.com\/#\/schema\/person\/b91d749826b21e606d55cda77d51ef47"},"headline":"Change Matplotlib Background Color With Examples","datePublished":"2021-02-20T12:57:51+00:00","dateModified":"2024-01-01T05:25:00+00:00","mainEntityOfPage":{"@id":"https:\/\/web.archive.org\/web\/20240926031316\/https:\/\/www.pythonpool.com.dream.website\/matplotlib-background-color\/"},"wordCount":489,"commentCount":0,"publisher":{"@id":"https:\/\/web.archive.org\/web\/20240926031316\/https:\/\/www.pythonpool.com\/#organization"},"image":{"@id":"https:\/\/web.archive.org\/web\/20240926031316\/https:\/\/www.pythonpool.com.dream.website\/matplotlib-background-color\/#primaryimage"},"thumbnailUrl":"https:\/\/web.archive.org\/web\/20240926031316\/https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/02\/Change-Matplotlib-Background-Color-With-Examples.png","keywords":["matplotlib change background color","matplotlib legend background color","matplotlib plot background color","matplotlib set background color"],"articleSection":["Matplotlib"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/web.archive.org\/web\/20240926031316\/https:\/\/www.pythonpool.com.dream.website\/matplotlib-background-color\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/web.archive.org\/web\/20240926031316\/https:\/\/www.pythonpool.com.dream.website\/matplotlib-background-color\/","url":"https:\/\/web.archive.org\/web\/20240926031316\/https:\/\/www.pythonpool.com.dream.website\/matplotlib-background-color\/","name":"Change Matplotlib Background Color With Examples - Python Pool","isPartOf":{"@id":"https:\/\/web.archive.org\/web\/20240926031316\/https:\/\/www.pythonpool.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/web.archive.org\/web\/20240926031316\/https:\/\/www.pythonpool.com.dream.website\/matplotlib-background-color\/#primaryimage"},"image":{"@id":"https:\/\/web.archive.org\/web\/20240926031316\/https:\/\/www.pythonpool.com.dream.website\/matplotlib-background-color\/#primaryimage"},"thumbnailUrl":"https:\/\/web.archive.org\/web\/20240926031316\/https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/02\/Change-Matplotlib-Background-Color-With-Examples.png","datePublished":"2021-02-20T12:57:51+00:00","dateModified":"2024-01-01T05:25:00+00:00","description":"matplotlib background color can be changed using the set_facecolor() method of an axes() object in Python. In this article, we will learn","breadcrumb":{"@id":"https:\/\/web.archive.org\/web\/20240926031316\/https:\/\/www.pythonpool.com.dream.website\/matplotlib-background-color\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/web.archive.org\/web\/20240926031316\/https:\/\/www.pythonpool.com.dream.website\/matplotlib-background-color\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/web.archive.org\/web\/20240926031316\/https:\/\/www.pythonpool.com.dream.website\/matplotlib-background-color\/#primaryimage","url":"https:\/\/web.archive.org\/web\/20240926031316\/https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/02\/Change-Matplotlib-Background-Color-With-Examples.png","contentUrl":"https:\/\/web.archive.org\/web\/20240926031316\/https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/02\/Change-Matplotlib-Background-Color-With-Examples.png","width":1350,"height":650,"caption":"matplotlib background color"},{"@type":"BreadcrumbList","@id":"https:\/\/web.archive.org\/web\/20240926031316\/https:\/\/www.pythonpool.com.dream.website\/matplotlib-background-color\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/web.archive.org\/web\/20240926031316\/https:\/\/www.pythonpool.com\/"},{"@type":"ListItem","position":2,"name":"Change Matplotlib Background Color With Examples"}]},{"@type":"WebSite","@id":"https:\/\/web.archive.org\/web\/20240926031316\/https:\/\/www.pythonpool.com\/#website","url":"https:\/\/web.archive.org\/web\/20240926031316\/https:\/\/www.pythonpool.com\/","name":"Python Pool","description":"Your One-Stop Python Learning Destination","publisher":{"@id":"https:\/\/web.archive.org\/web\/20240926031316\/https:\/\/www.pythonpool.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/web.archive.org\/web\/20240926031316\/https:\/\/www.pythonpool.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/web.archive.org\/web\/20240926031316\/https:\/\/www.pythonpool.com\/#organization","name":"Python Pool","url":"https:\/\/web.archive.org\/web\/20240926031316\/https:\/\/www.pythonpool.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/web.archive.org\/web\/20240926031316\/https:\/\/www.pythonpool.com\/#\/schema\/logo\/image\/","url":"https:\/\/web.archive.org\/web\/20240926031316\/https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/aa.png","contentUrl":"https:\/\/web.archive.org\/web\/20240926031316\/https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/aa.png","width":452,"height":185,"caption":"Python Pool"},"image":{"@id":"https:\/\/web.archive.org\/web\/20240926031316\/https:\/\/www.pythonpool.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/web.archive.org\/web\/20240926031316\/https:\/\/twitter.com\/pythonpool","https:\/\/web.archive.org\/web\/20240926031316\/https:\/\/www.youtube.com\/c\/pythonpool"]},{"@type":"Person","@id":"https:\/\/web.archive.org\/web\/20240926031316\/https:\/\/www.pythonpool.com\/#\/schema\/person\/b91d749826b21e606d55cda77d51ef47","name":"Prachee Sao","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/web.archive.org\/web\/20240926031316\/https:\/\/www.pythonpool.com\/#\/schema\/person\/image\/","url":"https:\/\/web.archive.org\/web\/20240926031316\/https:\/\/secure.gravatar.com\/avatar\/969eb9ba38e0aa5c3175935da2455ac7?s=96&d=wavatar&r=g","contentUrl":"https:\/\/web.archive.org\/web\/20240926031316\/https:\/\/secure.gravatar.com\/avatar\/969eb9ba38e0aa5c3175935da2455ac7?s=96&d=wavatar&r=g","caption":"Prachee Sao"}}]}},"_links":{"self":[{"href":"https:\/\/web.archive.org\/web\/20240926031316\/https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/9310"}],"collection":[{"href":"https:\/\/web.archive.org\/web\/20240926031316\/https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/web.archive.org\/web\/20240926031316\/https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/web.archive.org\/web\/20240926031316\/https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/web.archive.org\/web\/20240926031316\/https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/comments?post=9310"}],"version-history":[{"count":11,"href":"https:\/\/web.archive.org\/web\/20240926031316\/https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/9310\/revisions"}],"predecessor-version":[{"id":31443,"href":"https:\/\/web.archive.org\/web\/20240926031316\/https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/9310\/revisions\/31443"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/web.archive.org\/web\/20240926031316\/https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/media\/9359"}],"wp:attachment":[{"href":"https:\/\/web.archive.org\/web\/20240926031316\/https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/media?parent=9310"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/web.archive.org\/web\/20240926031316\/https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/categories?post=9310"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/web.archive.org\/web\/20240926031316\/https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/tags?post=9310"}],"curies":[{"name":"wp","href":"https:\/\/web.archive.org\/web\/20240926031316\/https:\/\/api.w.org\/{rel}","templated":true}]}}