{"id":5811,"date":"2020-12-07T20:14:29","date_gmt":"2020-12-07T14:44:29","guid":{"rendered":"http:\/\/www.pythonpool.com\/?p=5811"},"modified":"2021-06-14T16:36:58","modified_gmt":"2021-06-14T11:06:58","slug":"matplotlib-savefig","status":"publish","type":"post","link":"https:\/\/www.pythonpool.com\/matplotlib-savefig\/","title":{"rendered":"Matplotlib Savefig() For Different Parameters in Python"},"content":{"rendered":"\n<p>Hello programmers, in this article, we will study the Matplotlib savefig() in python. As we all know, Matplotlib is a beneficial visualization library in python, especially for plotting purposes. The Matplotlib savefig function, as the name suggests, helps save the figure after plotting the data. Finally, it saves the figure in the local memory of our system. Let me brief you with the syntax and return type of the Matplotlib savefig() function.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_74 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\" style=\"cursor:inherit\">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-savefig\/#Syntax_of_Matplotlib_savefig\" >Syntax of Matplotlib savefig()<\/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-savefig\/#Parameters\" >Parameters:<\/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-savefig\/#Return_type\" >Return type<\/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-savefig\/#Example_of_Matplotlib_Savefig_in_Python\" >Example of Matplotlib Savefig() in Python<\/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-savefig\/#Savefig_with_other_parameters\" >Savefig() with other parameters<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.pythonpool.com\/matplotlib-savefig\/#Matplotlib_Savefig_formats\" >Matplotlib Savefig() formats<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.pythonpool.com\/matplotlib-savefig\/#Change_size_using_Matplotlib_Savefig_in_Python\" >Change size using Matplotlib Savefig() in Python<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.pythonpool.com\/matplotlib-savefig\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\" id=\"h-syntax-of-matplotlib-savefig\"><span class=\"ez-toc-section\" id=\"Syntax_of_Matplotlib_savefig\"><\/span>Syntax of Matplotlib savefig()<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">savefig(fname, dpi=None, facecolor=\u2019w\u2019, edgecolor=\u2019w\u2019, orientation=\u2019portrait\u2019, papertype=None, format=None, transparent=False, bbox_inches=None, pad_inches=0.1, frameon=None, metadata=None)<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-parameters\"><span class=\"ez-toc-section\" id=\"Parameters\"><\/span><strong>Parameters:<\/strong> <span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>fname:<\/strong> (str or path-like or file-like) It determines the output format, and the file saves as fname. If the format is not present, then the format is the extension of fname, if there is one. If the fname has no extension, then the file is saved with default: &#8216;png,&#8217; and the appropriate extension is appended to the fname.<\/li><li><strong>dpi:<\/strong> Resolution in dots per inch.  <\/li><li><strong>facecolor(color or &#8216;auto&#8217;, default: &#8216;auto&#8217;):<\/strong> The facecolor of the figure. If &#8216;auto&#8217;, use the current figure facecolor. <\/li><li><strong>edgecolor(color or &#8216;auto&#8217;, default:&nbsp;&#8216;auto&#8217;):<\/strong> The edgecolor of the figure. If &#8216;auto&#8217;, use the current figure edgecolor. <\/li><li><strong>orientation &#8211; {&#8216;landscape,&#8217; &#8216;portrait&#8217;}:<\/strong> Currently only supported by the postscript backend. <\/li><li><strong>format(str):<\/strong> The file format, e.g. &#8216;png&#8217;, &#8216;pdf&#8217;, &#8216;svg&#8217;, &#8230; The behavior when this is unset is documented under&nbsp;fname. <\/li><li><strong>papertype:<\/strong> &nbsp;Papertypes can be \u201ca0 to a10\u201d, \u201cexecutive,\u201d \u201cb0 to b10\u201d, \u201cletter,\u201d \u201clegal,\u201d \u201cledger.\u201d <\/li><li><strong>bbox_inches:<\/strong> Only a given portion of the figure is saved. Set it as \u201ctight\u201d for the proper fit of the saved figure. <\/li><li><strong>pad_inches:<\/strong> (default: 0.1) Amount padding around the saved figure. <\/li><li><strong>transparent:<\/strong> Makes the background of the picture transparent. The figure patch will also be transparent unless face color and\/or edgecolor are specified via kwargs.<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-return-type\"><span class=\"ez-toc-section\" id=\"Return_type\"><\/span>Return type<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The matplotlib savefig() function saves the plotted figure in our local machines.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-example-of-matplotlib-savefig-in-python\"><span class=\"ez-toc-section\" id=\"Example_of_Matplotlib_Savefig_in_Python\"><\/span>Example of Matplotlib Savefig() in Python<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 \n  \n# creating plotting data \nx_axis =&#x5B;1, 4, 9, 16, 25, 36, 49, 64, 81, 100] \ny_axis =&#x5B;1, 2, 3, 4, 5, 6, 7, 8, 9, 10] \n  \n# plotting  \nplt.plot(x_axis, y_axis) \nplt.x_label(&quot;X&quot;) \nplt.y_label(&quot;Y&quot;) \n  \n# saving the file \nplt.savefig(&quot;squares.png&quot;) \n  \nplt.show() \n<\/pre><\/div>\n\n\n<p><strong>OUTPUT:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img decoding=\"async\" src=\"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/12\/image-4.png\" alt=\"Example of Matplotlib Savefig() in Python\" class=\"wp-image-5812\" width=\"345\" height=\"241\" srcset=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/12\/image-4.png 345w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/12\/image-4-300x210.png 300w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/12\/image-4-150x105.png 150w\" sizes=\"(max-width: 345px) 100vw, 345px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-explanation\"><strong>EXPLANATION:<\/strong><\/h3>\n\n\n\n<p>In the above example, a plot is drawn using the input values of the x_axis and y_axis. Once the plotting is over, it is first saved using the savefig() function. Only the &#8216;fname,&#8217; given as &#8220;Squares.png,&#8221; is an argument to the matplotlib savefig() function. The plotted figure is thus saved with the file name Squares under .png format in the local system.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-savefig-with-other-parameters\"><span class=\"ez-toc-section\" id=\"Savefig_with_other_parameters\"><\/span>Savefig() with other parameters<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 \n  \n  \n# creating data and plotting a histogram \nx =&#x5B;1, 4, 9, 16, 25, 36, 49, 64, 81, 100] \nplt.hist(x) \n  \n# saving the figure. \nplt.savefig(&quot;squares1.png&quot;, \n            bbox_inches =&quot;tight&quot;, \n            pad_inches = 1, \n            transparent = True, \n            facecolor =&quot;g&quot;, \n            orientation ='landscape') \n  \nplt.show() \n<\/pre><\/div>\n\n\n<p><strong>OUTPUT:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img decoding=\"async\" src=\"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/12\/image-7.png\" alt=\"Savefig() with other parameters\" class=\"wp-image-5815\" width=\"335\" height=\"250\" srcset=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/12\/image-7.png 328w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/12\/image-7-300x224.png 300w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/12\/image-7-150x112.png 150w\" sizes=\"(max-width: 335px) 100vw, 335px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-explanation-1\"><strong>EXPLANATION:<\/strong><\/h3>\n\n\n\n<p>Firstly, in the above example, a <a href=\"http:\/\/www.pythonpool.com\/matplotlib-2d-histogram\/\" target=\"_blank\" rel=\"noreferrer noopener\">histogram<\/a> is plotted by importing the Matplotlib library using the various input values. The figure is saved in the local system using the Matplotlib savefig() in Python. Parameters as arguments are necessary to obtain the saved figure as desired. The &#8216;fname&#8217; is &#8220;Squares.png,&#8221; which saves the figure under file name Squares and .png format. The bbox_inches =&#8221;tight&#8221; save the figure in a tight fit. And pad_inches = 1 gives padding of 1 around the saved figure. Also, the facecolor is &#8216;g,&#8217; which gives the green color. Finally, the orientation is &#8216;landscape,&#8217; which saves the figure in landscape mode.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-matplotlib-savefig-formats\"><span class=\"ez-toc-section\" id=\"Matplotlib_Savefig_formats\"><\/span>Matplotlib Savefig() formats<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 numpy as np\nimport matplotlib.pyplot as plt\n\nx = np.linspace(0, 10,20)\nm = 1\nc = 2\ny = m*x + c\n\nfig = plt.figure()\nplt.plot(x, y)\nplt.title(&quot;y=mx+c&quot;)\nplt.xlabel('x-axis')\nplt.ylabel('y-axis')\nfig.set_size_inches(5, 5)\n\nplt.savefig(&quot;Figure saved in jpg format.jpg&quot;)\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"h-explanation-2\"><strong>EXPLANATION:<\/strong><\/h3>\n\n\n\n<p>Firstly, to change the figure format using the Matplotlib savefig() function, we need to change the extension of the image file name in the savefig() function. In the above example, the file name&#8217;s extension in the savefig() method is .jpg, which saves the figure in jpg format. We can save plots in different formats like .png, .jpg, .pdf, .svg, and many more just by changing the files&#8217; extensions to save as desired in the savefig() methods.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-change-size-using-matplotlib-savefig-in-python\"><span class=\"ez-toc-section\" id=\"Change_size_using_Matplotlib_Savefig_in_Python\"><\/span>Change size using Matplotlib Savefig() in Python<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 numpy as np\nimport matplotlib.pyplot as plt\n\nx = np.linspace(0, 10, 0.5)\nm = 1\nc = 2\ny = m*x + c\n\nplt.figure(figsize=(10, 10))\nplt.savefig('750x750.png', dpi=75)\nplt.plot(x, y)\nplt.title(&quot;y=mx+c&quot;)\nplt.xlabel('x-axis')\nplt.ylabel('y-axis')\n\nplt.show()\n<\/pre><\/div>\n\n\n<p><strong>OUTPUT:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img decoding=\"async\" src=\"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/12\/image-23.png\" alt=\"Change size using Matplotlib Savefig() in Python\" class=\"wp-image-5895\" width=\"458\" height=\"335\" srcset=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/12\/image-23.png 531w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/12\/image-23-300x219.png 300w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/12\/image-23-150x110.png 150w\" sizes=\"(max-width: 458px) 100vw, 458px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-explanation-3\"><strong>EXPLANATION:<\/strong><\/h3>\n\n\n\n<p>To change the figure&#8217;s size using savefig(), we need to set the figure dimension in inches while instantiating the figure. And later, the dpi (Resolutions in dots per inch) is specified so that the <a href=\"https:\/\/en.wikipedia.org\/wiki\/Dimensional_analysis\" target=\"_blank\" rel=\"noreferrer noopener\">dimensions<\/a> of the saved image are correct.<\/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>In today&#8217;s article, we learned how to save figures with real-time examples using the plt.savefig() function. We used different methods and different combinations of parameters as per our choice. The best coding practice is to try all possible combinations of methods and parameters. Refer to this article for any queries related to the Matplotlib savefig() in Python.<\/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 programmers, in this article, we will study the Matplotlib savefig() in python. As we all know, Matplotlib is a beneficial visualization library in python, &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"Matplotlib Savefig() For Different Parameters in Python\" class=\"read-more button\" href=\"https:\/\/www.pythonpool.com\/matplotlib-savefig\/#more-5811\" aria-label=\"More on Matplotlib Savefig() For Different Parameters in Python\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":5900,"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":[2631,2635,2634,2630,2633,2637,2632,2629,2636],"class_list":["post-5811","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-matplotlib","tag-matplotlib-savefig-cut-off","tag-matplotlib-savefig-dpi","tag-matplotlib-savefig-example","tag-matplotlib-savefig-pdf","tag-matplotlib-savefig-resolution","tag-matplotlib-savefig-size","tag-python-matplotlib-savefig","tag-savefig-matplotlib","tag-savefig-matplotlib-size","infinite-scroll-item"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v20.1 (Yoast SEO v25.0) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Matplotlib Savefig() For Different Parameters in Python - Python Pool<\/title>\n<meta name=\"description\" content=\"Examples of Matplotlib savefig() in Python using various combinations of different method and parameters to save figure in your system.\" \/>\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\/matplotlib-savefig\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Matplotlib Savefig() For Different Parameters in Python\" \/>\n<meta property=\"og:description\" content=\"Hello programmers, in this article, we will study the Matplotlib savefig() in python. As we all know, Matplotlib is a beneficial visualization library in\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pythonpool.com\/matplotlib-savefig\/\" \/>\n<meta property=\"og:site_name\" content=\"Python Pool\" \/>\n<meta property=\"article:published_time\" content=\"2020-12-07T14:44:29+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-06-14T11:06:58+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/12\/Theatre-Actor-Portfolio-Website-7.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=\"Python Pool\" \/>\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=\"Python Pool\" \/>\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\/matplotlib-savefig\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.pythonpool.com\/matplotlib-savefig\/\"},\"author\":{\"name\":\"Python Pool\",\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/person\/f87448ee54c0ffd2889fbf2408c18998\"},\"headline\":\"Matplotlib Savefig() For Different Parameters in Python\",\"datePublished\":\"2020-12-07T14:44:29+00:00\",\"dateModified\":\"2021-06-14T11:06:58+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.pythonpool.com\/matplotlib-savefig\/\"},\"wordCount\":709,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.pythonpool.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.pythonpool.com\/matplotlib-savefig\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/12\/Theatre-Actor-Portfolio-Website-7.png\",\"keywords\":[\"matplotlib savefig cut off\",\"matplotlib savefig dpi\",\"matplotlib savefig example\",\"matplotlib savefig pdf\",\"matplotlib savefig resolution\",\"matplotlib savefig size\",\"python matplotlib savefig\",\"savefig matplotlib\",\"savefig matplotlib size\"],\"articleSection\":[\"Matplotlib\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.pythonpool.com\/matplotlib-savefig\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.pythonpool.com\/matplotlib-savefig\/\",\"url\":\"https:\/\/www.pythonpool.com\/matplotlib-savefig\/\",\"name\":\"Matplotlib Savefig() For Different Parameters in Python - Python Pool\",\"isPartOf\":{\"@id\":\"https:\/\/www.pythonpool.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.pythonpool.com\/matplotlib-savefig\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.pythonpool.com\/matplotlib-savefig\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/12\/Theatre-Actor-Portfolio-Website-7.png\",\"datePublished\":\"2020-12-07T14:44:29+00:00\",\"dateModified\":\"2021-06-14T11:06:58+00:00\",\"description\":\"Examples of Matplotlib savefig() in Python using various combinations of different method and parameters to save figure in your system.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.pythonpool.com\/matplotlib-savefig\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.pythonpool.com\/matplotlib-savefig\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.pythonpool.com\/matplotlib-savefig\/#primaryimage\",\"url\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/12\/Theatre-Actor-Portfolio-Website-7.png\",\"contentUrl\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/12\/Theatre-Actor-Portfolio-Website-7.png\",\"width\":1350,\"height\":650,\"caption\":\"matplotlib savefig\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.pythonpool.com\/matplotlib-savefig\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.pythonpool.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Matplotlib Savefig() For Different Parameters in Python\"}]},{\"@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\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"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\":\"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/aa.png\",\"contentUrl\":\"http:\/\/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:\/\/x.com\/pythonpool\",\"https:\/\/www.youtube.com\/c\/pythonpool\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/person\/f87448ee54c0ffd2889fbf2408c18998\",\"name\":\"Python Pool\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/fdd3cb9ad7f560324dfd481989550aa8ffce84388fd253c42beca35c999d3108?s=96&d=wavatar&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/fdd3cb9ad7f560324dfd481989550aa8ffce84388fd253c42beca35c999d3108?s=96&d=wavatar&r=g\",\"caption\":\"Python Pool\"}}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Matplotlib Savefig() For Different Parameters in Python - Python Pool","description":"Examples of Matplotlib savefig() in Python using various combinations of different method and parameters to save figure in your system.","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:\/\/www.pythonpool.com\/matplotlib-savefig\/","og_locale":"en_US","og_type":"article","og_title":"Matplotlib Savefig() For Different Parameters in Python","og_description":"Hello programmers, in this article, we will study the Matplotlib savefig() in python. As we all know, Matplotlib is a beneficial visualization library in","og_url":"https:\/\/www.pythonpool.com\/matplotlib-savefig\/","og_site_name":"Python Pool","article_published_time":"2020-12-07T14:44:29+00:00","article_modified_time":"2021-06-14T11:06:58+00:00","og_image":[{"width":1350,"height":650,"url":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/12\/Theatre-Actor-Portfolio-Website-7.png","type":"image\/png"}],"author":"Python Pool","twitter_card":"summary_large_image","twitter_creator":"@pythonpool","twitter_site":"@pythonpool","twitter_misc":{"Written by":"Python Pool","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.pythonpool.com\/matplotlib-savefig\/#article","isPartOf":{"@id":"https:\/\/www.pythonpool.com\/matplotlib-savefig\/"},"author":{"name":"Python Pool","@id":"https:\/\/www.pythonpool.com\/#\/schema\/person\/f87448ee54c0ffd2889fbf2408c18998"},"headline":"Matplotlib Savefig() For Different Parameters in Python","datePublished":"2020-12-07T14:44:29+00:00","dateModified":"2021-06-14T11:06:58+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pythonpool.com\/matplotlib-savefig\/"},"wordCount":709,"commentCount":0,"publisher":{"@id":"https:\/\/www.pythonpool.com\/#organization"},"image":{"@id":"https:\/\/www.pythonpool.com\/matplotlib-savefig\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/12\/Theatre-Actor-Portfolio-Website-7.png","keywords":["matplotlib savefig cut off","matplotlib savefig dpi","matplotlib savefig example","matplotlib savefig pdf","matplotlib savefig resolution","matplotlib savefig size","python matplotlib savefig","savefig matplotlib","savefig matplotlib size"],"articleSection":["Matplotlib"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.pythonpool.com\/matplotlib-savefig\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.pythonpool.com\/matplotlib-savefig\/","url":"https:\/\/www.pythonpool.com\/matplotlib-savefig\/","name":"Matplotlib Savefig() For Different Parameters in Python - Python Pool","isPartOf":{"@id":"https:\/\/www.pythonpool.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.pythonpool.com\/matplotlib-savefig\/#primaryimage"},"image":{"@id":"https:\/\/www.pythonpool.com\/matplotlib-savefig\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/12\/Theatre-Actor-Portfolio-Website-7.png","datePublished":"2020-12-07T14:44:29+00:00","dateModified":"2021-06-14T11:06:58+00:00","description":"Examples of Matplotlib savefig() in Python using various combinations of different method and parameters to save figure in your system.","breadcrumb":{"@id":"https:\/\/www.pythonpool.com\/matplotlib-savefig\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pythonpool.com\/matplotlib-savefig\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pythonpool.com\/matplotlib-savefig\/#primaryimage","url":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/12\/Theatre-Actor-Portfolio-Website-7.png","contentUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/12\/Theatre-Actor-Portfolio-Website-7.png","width":1350,"height":650,"caption":"matplotlib savefig"},{"@type":"BreadcrumbList","@id":"https:\/\/www.pythonpool.com\/matplotlib-savefig\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pythonpool.com\/"},{"@type":"ListItem","position":2,"name":"Matplotlib Savefig() For Different Parameters in Python"}]},{"@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":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"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":"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/aa.png","contentUrl":"http:\/\/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:\/\/x.com\/pythonpool","https:\/\/www.youtube.com\/c\/pythonpool"]},{"@type":"Person","@id":"https:\/\/www.pythonpool.com\/#\/schema\/person\/f87448ee54c0ffd2889fbf2408c18998","name":"Python Pool","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pythonpool.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/fdd3cb9ad7f560324dfd481989550aa8ffce84388fd253c42beca35c999d3108?s=96&d=wavatar&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/fdd3cb9ad7f560324dfd481989550aa8ffce84388fd253c42beca35c999d3108?s=96&d=wavatar&r=g","caption":"Python Pool"}}]}},"_links":{"self":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/5811","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/comments?post=5811"}],"version-history":[{"count":15,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/5811\/revisions"}],"predecessor-version":[{"id":13636,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/5811\/revisions\/13636"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/media\/5900"}],"wp:attachment":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/media?parent=5811"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/categories?post=5811"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/tags?post=5811"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}