{"id":5288,"date":"2023-11-09T10:33:09","date_gmt":"2023-11-09T10:33:09","guid":{"rendered":"https:\/\/www.pickl.ai\/blog\/?p=5288"},"modified":"2025-02-21T09:45:19","modified_gmt":"2025-02-21T09:45:19","slug":"matplotlib-cheat-sheet","status":"publish","type":"post","link":"https:\/\/www.pickl.ai\/blog\/matplotlib-cheat-sheet\/","title":{"rendered":"A Must-Have Matplotlib Cheat Sheet for Everyone"},"content":{"rendered":"\n<p><strong>Summary:<\/strong>\u00a0 This Matplotlib Cheat Sheet covers installation, basic and advanced plotting, customisation, and saving figures. Learn how to create line, bar, and scatter plots, customise titles and colours, and optimise visualisation quality. Whether a beginner or an expert, this guide helps you master Matplotlib for effective data storytelling and analysis.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of 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: #999;color:#999\" 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: #999;color:#999\" 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 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.pickl.ai\/blog\/matplotlib-cheat-sheet\/#Introduction\" >Introduction<\/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.pickl.ai\/blog\/matplotlib-cheat-sheet\/#What_is_Matplotlib\" >What is Matplotlib?<\/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.pickl.ai\/blog\/matplotlib-cheat-sheet\/#Installing_and_Importing_Matplotlib\" >Installing and Importing Matplotlib<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.pickl.ai\/blog\/matplotlib-cheat-sheet\/#How_to_Install_Matplotlib\" >How to Install Matplotlib<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.pickl.ai\/blog\/matplotlib-cheat-sheet\/#How_to_Import_Matplotlib\" >How to Import Matplotlib<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.pickl.ai\/blog\/matplotlib-cheat-sheet\/#Creating_Basic_Plots_in_Matplotlib\" >Creating Basic Plots in Matplotlib<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.pickl.ai\/blog\/matplotlib-cheat-sheet\/#Making_a_Line_Plot\" >Making a Line Plot<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.pickl.ai\/blog\/matplotlib-cheat-sheet\/#Making_a_Scatter_Plot\" >Making a Scatter Plot<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.pickl.ai\/blog\/matplotlib-cheat-sheet\/#Making_a_Bar_Chart\" >Making a Bar Chart<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.pickl.ai\/blog\/matplotlib-cheat-sheet\/#Customising_Plots_in_Matplotlib\" >Customising Plots in Matplotlib<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/www.pickl.ai\/blog\/matplotlib-cheat-sheet\/#Adding_Titles_Labels_and_Legends\" >Adding Titles, Labels, and Legends<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/www.pickl.ai\/blog\/matplotlib-cheat-sheet\/#Changing_Colors_and_Markers\" >Changing Colors and Markers<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/www.pickl.ai\/blog\/matplotlib-cheat-sheet\/#Adding_a_Grid_and_Changing_Styles\" >Adding a Grid and Changing Styles<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/www.pickl.ai\/blog\/matplotlib-cheat-sheet\/#Working_with_Subplots\" >Working with Subplots<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/www.pickl.ai\/blog\/matplotlib-cheat-sheet\/#Creating_Multiple_Plots_in_One_Figure\" >Creating Multiple Plots in One Figure<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/www.pickl.ai\/blog\/matplotlib-cheat-sheet\/#Adjusting_Layout\" >Adjusting Layout<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/www.pickl.ai\/blog\/matplotlib-cheat-sheet\/#Exploring_Advanced_Plot_Types\" >Exploring Advanced Plot Types<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/www.pickl.ai\/blog\/matplotlib-cheat-sheet\/#Histogram\" >Histogram<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-19\" href=\"https:\/\/www.pickl.ai\/blog\/matplotlib-cheat-sheet\/#Box_Plot\" >Box Plot<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-20\" href=\"https:\/\/www.pickl.ai\/blog\/matplotlib-cheat-sheet\/#Heatmap\" >Heatmap<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-21\" href=\"https:\/\/www.pickl.ai\/blog\/matplotlib-cheat-sheet\/#Saving_and_Exporting_Figures\" >Saving and Exporting Figures<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-22\" href=\"https:\/\/www.pickl.ai\/blog\/matplotlib-cheat-sheet\/#Saving_a_Figure_in_Different_File_Formats\" >Saving a Figure in Different File Formats<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-23\" href=\"https:\/\/www.pickl.ai\/blog\/matplotlib-cheat-sheet\/#Adjusting_DPI_and_Resolution_for_Better_Quality\" >Adjusting DPI and Resolution for Better Quality<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-24\" href=\"https:\/\/www.pickl.ai\/blog\/matplotlib-cheat-sheet\/#Useful_Tips_and_Tricks\" >Useful Tips and Tricks<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-25\" href=\"https:\/\/www.pickl.ai\/blog\/matplotlib-cheat-sheet\/#Matplotlib_Not_Installed\" >Matplotlib Not Installed<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-26\" href=\"https:\/\/www.pickl.ai\/blog\/matplotlib-cheat-sheet\/#Figures_Not_Displaying\" >Figures Not Displaying<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-27\" href=\"https:\/\/www.pickl.ai\/blog\/matplotlib-cheat-sheet\/#Making_Matplotlib_Run_Faster\" >Making Matplotlib Run Faster<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-28\" href=\"https:\/\/www.pickl.ai\/blog\/matplotlib-cheat-sheet\/#In_The_End\" >In The End<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-29\" href=\"https:\/\/www.pickl.ai\/blog\/matplotlib-cheat-sheet\/#Frequently_Asked_Questions\" >Frequently Asked Questions<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-30\" href=\"https:\/\/www.pickl.ai\/blog\/matplotlib-cheat-sheet\/#What_is_Matplotlib_used_for\" >What is Matplotlib used for?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-31\" href=\"https:\/\/www.pickl.ai\/blog\/matplotlib-cheat-sheet\/#How_do_I_install_and_import_Matplotlib\" >How do I install and import Matplotlib?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-32\" href=\"https:\/\/www.pickl.ai\/blog\/matplotlib-cheat-sheet\/#How_can_I_customise_plots_in_Matplotlib\" >How can I customise plots in Matplotlib?<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2 id=\"introduction\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Introduction\"><\/span><strong>Introduction<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Matplotlib is a powerful tool for creating <a href=\"https:\/\/pickl.ai\/blog\/data-visualisation-using-matplotlib-in-python-a-comprehensive-guide\/\">visual representations of data<\/a>. Whether a beginner or an expert, Matplotlib allows you to create different graphs.<\/p>\n\n\n\n<p>This Matplotlib Cheat Sheet will guide you through the basics, from installation to advanced customisation. The goal is to help you quickly learn how to create and modify charts with simple commands. By the end, you\u2019ll be able to visualise data easily.<\/p>\n\n\n\n<p><strong>Key Takeaways<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Matplotlib helps create charts like line, bar, and scatter plots with Python.<\/li>\n\n\n\n<li>Installation is simple using pip install matplotlib, imported as plt.<\/li>\n\n\n\n<li>Customisation options include titles, labels, colours, legends, and grid styles.<\/li>\n\n\n\n<li>Subplots help compare multiple datasets within a single figure.<\/li>\n\n\n\n<li>Matplotlib allows saving figures in multiple formats like PNG, PDF, and SVG.<\/li>\n<\/ul>\n\n\n\n<h2 id=\"what-is-matplotlib\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_is_Matplotlib\"><\/span><strong>What is Matplotlib?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Matplotlib is a tool that helps us create charts and graphs using <a href=\"https:\/\/pickl.ai\/blog\/gigantic-python\/\">Python<\/a>. If you have ever seen a bar chart, line graph, or pie chart, you can easily make them with Matplotlib. It turns numbers into pictures so we can understand data better.<\/p>\n\n\n\n<p>You don\u2019t need to be a coding expert to use it. With just a few simple commands, you can create clear and colourful visualisations. Whether you\u2019re a student, a beginner, or someone working with data, Matplotlib makes it easy to present information in a way anyone can understand.<\/p>\n\n\n\n<h2 id=\"installing-and-importing-matplotlib\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Installing_and_Importing_Matplotlib\"><\/span><strong>Installing and Importing Matplotlib<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Before we start creating beautiful charts, we need to install Matplotlib on our computer. If you haven&#8217;t installed it yet, don&#8217;t worry\u2014it&#8217;s simple!<\/p>\n\n\n\n<h3 id=\"how-to-install-matplotlib\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_Install_Matplotlib\"><\/span><strong>How to Install Matplotlib<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>To install Matplotlib, open your command prompt (Windows) or terminal (Mac\/Linux) and type this command:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXfgsIhbJUw7MICmorcnikBUpaCTiT7C2J0e0N_r5Y1HHWUl0y4bPdwOh4wNFRqVYHprDKlCh4uel6NHwY-ZYo916KAFC4193Qcu5Xd6zXw0o-tjr-GCPhmTRAIMbhsDMf2-TGokBw?key=RhUW57RMJR-hY1_FlNxzrg\" alt=\"Install Matplotlib using pip command.\"\/><\/figure>\n\n\n\n<p>Press <strong>Enter<\/strong>, and the installation will begin. It might take a few seconds. Once it&#8217;s done, Matplotlib is ready to use!<\/p>\n\n\n\n<h3 id=\"how-to-import-matplotlib\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_Import_Matplotlib\"><\/span><strong>How to Import Matplotlib<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>After installing, we need to bring Matplotlib into our Python program. We do this by using the <strong>import<\/strong> statement. Here\u2019s the basic way to import it:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXfXMCNhcf5xXPHlaFqJivZIReBFx8V2JHLJbOqbZQzKtuPP44bOnkViv1gNNYrkGNji26sXRpyn7P7evIpOFlvKelZ_o2MwUqlQRG3jW2gSkT-bMayJWImKOAgvf7atLLWrasrycA?key=RhUW57RMJR-hY1_FlNxzrg\" alt=\"Import Matplotlib pyplot as plt.\"\/><\/figure>\n\n\n\n<p>We use pyplot, a part of Matplotlib, to create charts easily. The plt is just a short name that helps us type less code.<\/p>\n\n\n\n<p>Now, Matplotlib is set up, and we can start making different types of graphs like line charts, bar charts, and scatter plots. In the next sections, I&#8217;ll show you how to use Matplotlib to create simple and clear visualisations.<\/p>\n\n\n\n<h2 id=\"creating-basic-plots-in-matplotlib\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Creating_Basic_Plots_in_Matplotlib\"><\/span><strong>Creating Basic Plots in Matplotlib<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Now that we have installed and imported Matplotlib, let\u2019s create some basic charts. We\u2019ll start with a line plot, then move to a scatter plot, and finally make a bar chart. These charts help us visualise data in different ways.<\/p>\n\n\n\n<h3 id=\"making-a-line-plot\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Making_a_Line_Plot\"><\/span><strong>Making a Line Plot<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>A line plot is useful for showing trends over time. Here\u2019s how we create one:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXeRUWHt6tYyZh8m9lxHJFNFOxSaPPfFdOd0OtWXPMNjno7d3ZOu5u1i182TMSCqkTO_QvYire4klHWM4uxy2ZYTjnZcwHib1iEuPvXP3Axy3lKIyVRXGf3uX1oF2gx4DXYd416EWg?key=RhUW57RMJR-hY1_FlNxzrg\" alt=\"A simple line plot with x and y values.\"\/><\/figure>\n\n\n\n<p>This code plots a line connecting the points (1,10), (2,15), etc. The plt.show() command displays the chart.<\/p>\n\n\n\n<h3 id=\"making-a-scatter-plot\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Making_a_Scatter_Plot\"><\/span><strong>Making a Scatter Plot<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>A scatter plot is great for showing relationships between two sets of values. Here\u2019s an example:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXeh6EMIS1lQzoJaOx5tBpDAsgAUw15nW4Nd1aAfoxQu1cTot6RdFuYQuGuDRq3_0WQtqZwGhKziWX57A6l-4FXNN7_tEZJmbdJ0WGZCE9nDWUUM4sfdKUo2V6d_1sEQP8AOeVu_fA?key=RhUW57RMJR-hY1_FlNxzrg\" alt=\"A simple scatter plot with x and y values.\"\/><\/figure>\n\n\n\n<p>Instead of a line, this creates individual points on the graph. Scatter plots help when we want to see patterns in data.<\/p>\n\n\n\n<h3 id=\"making-a-bar-chart\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Making_a_Bar_Chart\"><\/span><strong>Making a Bar Chart<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>A bar chart is useful for comparing different categories. Here\u2019s how we make one:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXdhkYgNRk6J8s1y0wwbnLeiikP8AcsnqIMtIY-I-Il7I5GBsaPInFwqXr2VdrdzAHBD-MCExSbYkctMp4xwz3n7y6NdZLAZby53QOQr81p_ZWmIgyQHCmyAVpGDfgSyUkl516halQ?key=RhUW57RMJR-hY1_FlNxzrg\" alt=\"A simple bar chart with categories and values.\"\/><\/figure>\n\n\n\n<p>Each bar represents a category with its corresponding value. Bar charts make comparisons easy to understand.<\/p>\n\n\n\n<p>Now, you can create these basic plots using Matplotlib and start clearly visualising data!<\/p>\n\n\n\n<h2 id=\"customising-plots-in-matplotlib\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Customising_Plots_in_Matplotlib\"><\/span><strong>Customising Plots in Matplotlib<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Once we create a basic plot, we often need to customise it to make it clear and visually appealing. Matplotlib allows us to add titles, labels, colours, and more to make our graphs easy to understand. Let\u2019s go step by step!<\/p>\n\n\n\n<h3 id=\"adding-titles-labels-and-legends\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Adding_Titles_Labels_and_Legends\"><\/span><strong>Adding Titles, Labels, and Legends<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>A title tells what the graph is about, while labels help us understand the axes. If we have multiple lines or bars, a legend helps differentiate them.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXfER0ltGMBmEM4wgdxCVEddlwazjYIFVOHFRcU9M3HPlgnVrtzOyweHpvLv7gzw1-jw-DHT9-kj0cCU5B9YhRYr5TPRSJrM0t-7wCf_0uK5ZZeuQx0Q9F6Yyns0SjaRZaf2cyKq?key=RhUW57RMJR-hY1_FlNxzrg\" alt=\"Add title, labels, and legend to a plot.\"\/><\/figure>\n\n\n\n<h3 id=\"changing-colors-and-markers\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Changing_Colors_and_Markers\"><\/span><strong>Changing Colors and Markers<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>We can change the color of lines and use markers to highlight data points.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXeSulwsSnHTZ7-NBaNiJXnOzLJY31sLmkLDtuiDNVkMPjlcMoEJLBKy4RkAYcAt6DLdsX0n78Dyx19gx5_kDbyFCC36Be3iEhDtC_vfk-wuCxxuipFmYdTiybshBCOglbeGE0CwXA?key=RhUW57RMJR-hY1_FlNxzrg\" alt=\"Customise the plot with colour and markers.\"\/><\/figure>\n\n\n\n<h3 id=\"adding-a-grid-and-changing-styles\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Adding_a_Grid_and_Changing_Styles\"><\/span><strong>Adding a Grid and Changing Styles<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>A grid helps in reading values easily, while styles change the overall look of the chart.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXeAe3VU1Dn6qem-qjW4vZb-bFh3Z3psxedPcAL3bkfCN19U64yBmN6Atf4UhgAUzvdEiP3HjJ8oPSrIwgWWlfu8RJ-9s7jQxjgw2iDTOMlEzq836ErhD6_2S94KsQJjWcZk2Nl--Q?key=RhUW57RMJR-hY1_FlNxzrg\" alt=\"Add a grid and apply a plot style.\"\/><\/figure>\n\n\n\n<p>With these simple customisations, our plots become more readable and attractive!<\/p>\n\n\n\n<h2 id=\"working-with-subplots\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Working_with_Subplots\"><\/span><strong>Working with Subplots<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Sometimes, we need to display multiple charts in a single figure to compare data easily. Instead of creating separate charts, we can use subplots to arrange multiple plots in one figure. This makes our visualisations more organised and easier to understand.<\/p>\n\n\n\n<h3 id=\"creating-multiple-plots-in-one-figure\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Creating_Multiple_Plots_in_One_Figure\"><\/span><strong>Creating Multiple Plots in One Figure<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>We use plt.subplot(rows, columns, index) to create subplots. Here\u2019s a simple example:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXd-wmSJx-EZnAjsE8gF4a2Tbhj9sboeVG4EVdH7FyLxu8ftNA2yMbZgHMY0ZjobUeD0QTvr-fZZFhG8B1PV5BAYlK3Yg0eV-2bPP5RiBVgRyWEVUcEia0yfQmOi6O9qdw2fsNlm?key=RhUW57RMJR-hY1_FlNxzrg\" alt=\"Create two subplots with sine and cosine waves.\"\/><\/figure>\n\n\n\n<p>Here, we divided the figure into 2 rows and 1 column. The first plot (sine wave) appears at position 1, and the second plot (cosine wave) appears at position 2.<\/p>\n\n\n\n<h3 id=\"adjusting-layout\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Adjusting_Layout\"><\/span><strong>Adjusting Layout<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Sometimes, subplots may overlap or appear too close. We can fix this using plt.tight_layout(), automatically adjusting the spacing.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXc7hKFfT1JmWjbdALbSfipWOGIHHBJZdpjo9FiYR_QCSnQ-Fm9fWSZFNJOUq3l2xjdj04_Gv8OjZj7P5NnzKmY0KOABONblpRsk4YNOpj1xUUjGPOfqladp64mZF-BK_g-C416y-Q?key=RhUW57RMJR-hY1_FlNxzrg\" alt=\"Adjust subplot layout to avoid overlap.\"\/><\/figure>\n\n\n\n<p>For more control, we can use plt.subplots_adjust(left, right, top, bottom, wspace, hspace). The wspace and hspace adjust spacing between columns and rows.<\/p>\n\n\n\n<p>We can easily compare different datasets within the same figure with subplots and create well-organised visualisations!<\/p>\n\n\n\n<h2 id=\"exploring-advanced-plot-types\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Exploring_Advanced_Plot_Types\"><\/span><strong>Exploring Advanced Plot Types<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Matplotlib allows us to create advanced charts that help in understand data better. Let\u2019s explore three useful plot types: Histogram, Box Plot, and <a href=\"https:\/\/pickl.ai\/blog\/how-to-create-a-heatmap-in-power-bi\/\">Heatmap<\/a>.<\/p>\n\n\n\n<h3 id=\"histogram\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Histogram\"><\/span><strong>Histogram<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>A histogram shows how often different values appear in a dataset. It groups data into bins and helps us see patterns.<\/p>\n\n\n\n<p>Here\u2019s how we create a histogram:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXcE-9ZSH-O6fi-oeULMFCWwMj0xfG499gfHa1lsPV2_Cth9WhmOhe_Mi718uXexYA4uGMl7-cRxfqAs-KgnkooL5VTD94MumdoBZQpq5mj8eiBY6St_BkyPL-4E3Wph65lX-oBaew?key=RhUW57RMJR-hY1_FlNxzrg\" alt=\"A simple histogram showing data distribution.\"\/><\/figure>\n\n\n\n<h3 id=\"box-plot\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Box_Plot\"><\/span><strong>Box Plot<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>A <a href=\"https:\/\/pickl.ai\/blog\/box-plot-in-data-visualisation-definition-and-components\/\">box plot<\/a> (or whisker plot) helps us see how data is spread. It shows the minimum, first quartile, median, third quartile, and maximum values.<\/p>\n\n\n\n<p>Here\u2019s how we create a box plot:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXdYmEXVZya5BtGlb-uCGxK5UZsM-mAAOvlo9dgjEMWCOK3jOs6oPzREkWaMeyWbnMkv_j6Lv_EJyEADSIW9ab9TbH4bx7-6Hf2C7t306GSSaak3lcKF6-pb8VcoUE19vVFiiT8sYA?key=RhUW57RMJR-hY1_FlNxzrg\" alt=\"A simple box plot showing data spread.\"\/><\/figure>\n\n\n\n<h3 id=\"heatmap\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Heatmap\"><\/span><strong>Heatmap<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>A heatmap uses colours to show values in a table format. Though Matplotlib doesn\u2019t have a built-in heatmap function, we can use imshow().<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXcVuu8Ker4oWhnKxIPsQDYlaKbgk71nh8jpwdrkalPrvlmIK1NCpsrEwgdq3Ij_Teb4tFgEAY-xlCtHgLJ_Oc2g8xC_pXz_dA0bnTRM3mrnKQFSxysF8PCGfD2ZiqKGYIHBdBKiaQ?key=RhUW57RMJR-hY1_FlNxzrg\" alt=\"A heatmap showing color-coded values.\"\/><\/figure>\n\n\n\n<p>These plots help us see data patterns differently, making analysis easier.<\/p>\n\n\n\n<h2 id=\"saving-and-exporting-figures\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Saving_and_Exporting_Figures\"><\/span><strong>Saving and Exporting Figures<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Once I create a chart using Matplotlib, I often need to save it as an image to use in reports, presentations, or websites. Thankfully, Matplotlib makes this process very simple.<\/p>\n\n\n\n<h3 id=\"saving-a-figure-in-different-file-formats\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Saving_a_Figure_in_Different_File_Formats\"><\/span><strong>Saving a Figure in Different File Formats<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Matplotlib allows me to save my chart in formats like <a href=\"https:\/\/www.95visual.com\/resources\/articles\/svg-pdf-jpg-png-whats-the-difference\" rel=\"nofollow\">PNG, PDF, and SVG<\/a>. Here&#8217;s how I do it:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXcOEIb53EVzzISBZgSr90yhjSmXcDS6xg-6dMXK5Yh9JX9-uxRGwPb4z7STWXE8pSpyOsuG-TZrsTNEApXUNnvHA0LdrpAgfe-_Hb9GjpgFSeUdFRoaNzaIKzx1_QQdYUUkFbq7AQ?key=RhUW57RMJR-hY1_FlNxzrg\" alt=\"Save chart as a PNG file.\"\/><\/figure>\n\n\n\n<p>This saves my chart as a PNG file, which is great for websites and sharing online. If I need a PDF file for printing or documents, I use:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXe6zNvMzhmlGpVeW7WNi7BoZKMpY1Sba1M8D-pLJC8ek4GitVP7ySm-5gZ-Q9_nacp1vTRi7EKdyuofN-Wh5BLNS1C7zuw-uQajGjsUbHHOpHH3tx9PVcQf9I_2WYMJl54PtTW_zw?key=RhUW57RMJR-hY1_FlNxzrg\" alt=\"Save chart as a PDF file.\"\/><\/figure>\n\n\n\n<p>If I want a SVG file, which is best for resising without losing quality, I use:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXf4KgtsPqL2cAx7L5ybbVI-OODojg9RXUoN7r8WayiM4pkZs2KXUw2UXhoBsh5zozb11fPYDt0mkC6Llra3R7fX5Dy3fDL5NTFqv2OsWV8UfSKvmEYWfymxYr7y1o7FivBj6z4J9A?key=RhUW57RMJR-hY1_FlNxzrg\" alt=\"Save chart as an SVG file.\"\/><\/figure>\n\n\n\n<h3 id=\"adjusting-dpi-and-resolution-for-better-quality\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Adjusting_DPI_and_Resolution_for_Better_Quality\"><\/span><strong>Adjusting DPI and Resolution for Better Quality<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Sometimes, I need my chart to look sharper, especially when printing or displaying on high-resolution screens. I can increase the DPI (dots per inch) setting like this:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXdH4vwes54KcTCmn_gC_Y2mBczD5tJQHxcN2H5M3olsvDGBooSmoG67BK18CFnYXaGAex7e4VwUw_WyWRjfWXRl13g75vakJmhwcOHEGQ0GxEX6EeAWGsPOTmBuM359lmxLEBrCvw?key=RhUW57RMJR-hY1_FlNxzrg\" alt=\"Save chart with 300 DPI resolution.\"\/><\/figure>\n\n\n\n<p>A higher DPI means a clearer image, but the file size will be larger. I usually use 300 DPI for high-quality images and 100 DPI for quick previews.<\/p>\n\n\n\n<p>By saving my figures in the right format and resolution, I ensure they look great no matter where I use them. Now, I can easily share my visualisations with others!<\/p>\n\n\n\n<h2 id=\"useful-tips-and-tricks\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Useful_Tips_and_Tricks\"><\/span><strong>Useful Tips and Tricks<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>While using Matplotlib, you might run into some errors or notice that your graphs take too long to load. Don&#8217;t worry! Here are some simple solutions to common issues and ways to make Matplotlib work faster.<\/p>\n\n\n\n<h3 id=\"matplotlib-not-installed\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Matplotlib_Not_Installed\"><\/span><strong>Matplotlib Not Installed<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>If you get an error like ModuleNotFoundError: No module named &#8216;matplotlib&#8217;, it means Matplotlib is missing. Install it using:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXd4RtsQk6rh7ExWhMoqb5-MwG1RPp_3ngSW-_zkqsNBDSYUTiahDMqhxnlyiY9kh8a4OgERXqRi1etwUh00fJort0dJd6pVMYQ-dhYvq4XBjykelgGYCyJQrnZtfNy7bQ5lYaBIkg?key=RhUW57RMJR-hY1_FlNxzrg\" alt=\"Fix missing Matplotlib module error.\"\/><\/figure>\n\n\n\n<h3 id=\"figures-not-displaying\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Figures_Not_Displaying\"><\/span><strong>Figures Not Displaying<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>If your graph doesn\u2019t show up, try adding this line at the end of your code:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXcuaiJbJLqH1hqAmLupGrGepxCiY1_qXacNwKQ27vYQ595-DjyKYQLD_0iNTfxtT5mjdi5BZb4XckpFHN6ylXyGrLtu-b0xx9zMVV0yxwpeVPbsdr936O7fnAJTthUdcw73AOBzKQ?key=RhUW57RMJR-hY1_FlNxzrg\" alt=\"Use plt.show() to display the plot.\"\/><\/figure>\n\n\n\n<h3 id=\"making-matplotlib-run-faster\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Making_Matplotlib_Run_Faster\"><\/span><strong>Making Matplotlib Run Faster<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Use Fewer Data Points<\/li>\n<\/ul>\n\n\n\n<p>If your graph is slow, reduce the number of data points before plotting.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Save Instead of Displaying<\/li>\n<\/ul>\n\n\n\n<p>Instead of showing a plot every time, save it as an image:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXeDUYV6KQ2rQmlcXXuLTCZk3SgExc174y788zC6VMBAXd6QteipnpwlZ7948d1hPnfFu1sB2sQ4dQ_c2O8Ej7W-pQHSWEcSHXD0ZWjYGo1gzpc69ELbcxFyolrFHJoqytzOwoUCYQ?key=RhUW57RMJR-hY1_FlNxzrg\" alt=\"Save Matplotlib figure as an image.\"\/><\/figure>\n\n\n\n<p>By following these tips, you can avoid errors and speed up your visualisations easily!<\/p>\n\n\n\n<h2 id=\"in-the-end\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"In_The_End\"><\/span><strong>In The End<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Matplotlib is an essential Python library for creating clear and effective data visualisations. This Matplotlib Cheat Sheet provides a quick reference for installing, importing, and using Matplotlib to create various plots like line, bar, scatter, and advanced charts.&nbsp;<\/p>\n\n\n\n<p>You also learned how to customise plots, work with subplots, and save figures in different formats. By mastering these basics, you can enhance your data storytelling skills and present insights more effectively.&nbsp;<\/p>\n\n\n\n<p>Whether you\u2019re a beginner or an experienced user, this guide ensures you can quickly generate professional-looking graphs. Keep experimenting with Matplotlib to refine your visualisation techniques and boost efficiency.<\/p>\n\n\n\n<p>To deepen your knowledge and gain hands-on experience with Matplotlib and other essential <a href=\"https:\/\/pickl.ai\/blog\/top-10-data-science-tools-for-2024\/\">Data Science tools<\/a>, join Data Science courses by <a href=\"http:\/\/pickl.ai\"><strong>Pickl.AI<\/strong><\/a>. These courses provide structured learning, real-world projects, and expert guidance to help you become a proficient data professional. Start your journey today!<\/p>\n\n\n\n<h2 id=\"frequently-asked-questions\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Frequently_Asked_Questions\"><\/span><strong>Frequently Asked Questions<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 id=\"what-is-matplotlib-used-for\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_is_Matplotlib_used_for\"><\/span><strong>What is Matplotlib used for?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Matplotlib is a Python library for creating static, animated, and interactive visualisations. It helps users generate plots like line graphs, bar charts, scatter plots, histograms, and more. With customisation options, Matplotlib makes data visualisation easy, assisting analysts to, scientists, and developers present insights effectively in reports and dashboards.<\/p>\n\n\n\n<h3 id=\"how-do-i-install-and-import-matplotlib\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_do_I_install_and_import_Matplotlib\"><\/span><strong>How do I install and import Matplotlib?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>To install Matplotlib, run pip install matplotlib in your command prompt or terminal. After installation, import it into your Python script using import matplotlib.pyplot as plt. This allows you to create various plots, customise them, and display or save them for presentations, reports, or research papers.<\/p>\n\n\n\n<h3 id=\"how-can-i-customise-plots-in-matplotlib\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_can_I_customise_plots_in_Matplotlib\"><\/span><strong>How can I customise plots in Matplotlib?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>You can customise Matplotlib plots by adding titles, labels, legends, and colours. Use plt.title(), plt.xlabel(), and plt.ylabel() for clarity. Change colours and markers using arguments in plt.plot(). Apply styles using plt.style.use(), and add a grid with plt.grid(True). These enhancements improve readability and presentation quality.<\/p>\n","protected":false},"excerpt":{"rendered":"Learn Matplotlib with this cheat sheet\u2014install and save stunning Python visualisations.\n","protected":false},"author":19,"featured_media":20102,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[1840],"tags":[1910,1913,1911,1912],"ppma_author":[2186,2183],"class_list":{"0":"post-5288","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-python","8":"tag-matplotlib-cheat-sheet","9":"tag-matplotlib-cheat-sheet-github","10":"tag-matplotlib-cheat-sheet-with-examples","11":"tag-matplotlib-in-python"},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v20.3 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Matplotlib Cheat Sheet: Everything You Need to Know<\/title>\n<meta name=\"description\" content=\"Explore this Matplotlib Cheat Sheet to learn how to install, create, customise, and save charts in Python. Enhance your skills.\" \/>\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.pickl.ai\/blog\/matplotlib-cheat-sheet\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"A Must-Have Matplotlib Cheat Sheet for Everyone\" \/>\n<meta property=\"og:description\" content=\"Explore this Matplotlib Cheat Sheet to learn how to install, create, customise, and save charts in Python. Enhance your skills.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pickl.ai\/blog\/matplotlib-cheat-sheet\/\" \/>\n<meta property=\"og:site_name\" content=\"Pickl.AI\" \/>\n<meta property=\"article:published_time\" content=\"2023-11-09T10:33:09+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-02-21T09:45:19+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/11\/image9-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"800\" \/>\n\t<meta property=\"og:image:height\" content=\"500\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Versha Rawat, Nitin Choudhary\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Versha Rawat\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"12 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.pickl.ai\\\/blog\\\/matplotlib-cheat-sheet\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pickl.ai\\\/blog\\\/matplotlib-cheat-sheet\\\/\"},\"author\":{\"name\":\"Versha Rawat\",\"@id\":\"https:\\\/\\\/www.pickl.ai\\\/blog\\\/#\\\/schema\\\/person\\\/0310c70c058fe2f3308f9210dc2af44c\"},\"headline\":\"A Must-Have Matplotlib Cheat Sheet for Everyone\",\"datePublished\":\"2023-11-09T10:33:09+00:00\",\"dateModified\":\"2025-02-21T09:45:19+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.pickl.ai\\\/blog\\\/matplotlib-cheat-sheet\\\/\"},\"wordCount\":1680,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/www.pickl.ai\\\/blog\\\/matplotlib-cheat-sheet\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.pickl.ai\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/11\\\/image9-1.png\",\"keywords\":[\"Matplotlib cheat sheet\",\"matplotlib cheat sheet github\",\"Matplotlib cheat sheet with examples\",\"matplotlib in python\"],\"articleSection\":[\"Python\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.pickl.ai\\\/blog\\\/matplotlib-cheat-sheet\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.pickl.ai\\\/blog\\\/matplotlib-cheat-sheet\\\/\",\"url\":\"https:\\\/\\\/www.pickl.ai\\\/blog\\\/matplotlib-cheat-sheet\\\/\",\"name\":\"Matplotlib Cheat Sheet: Everything You Need to Know\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pickl.ai\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.pickl.ai\\\/blog\\\/matplotlib-cheat-sheet\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.pickl.ai\\\/blog\\\/matplotlib-cheat-sheet\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.pickl.ai\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/11\\\/image9-1.png\",\"datePublished\":\"2023-11-09T10:33:09+00:00\",\"dateModified\":\"2025-02-21T09:45:19+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.pickl.ai\\\/blog\\\/#\\\/schema\\\/person\\\/0310c70c058fe2f3308f9210dc2af44c\"},\"description\":\"Explore this Matplotlib Cheat Sheet to learn how to install, create, customise, and save charts in Python. Enhance your skills.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.pickl.ai\\\/blog\\\/matplotlib-cheat-sheet\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.pickl.ai\\\/blog\\\/matplotlib-cheat-sheet\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.pickl.ai\\\/blog\\\/matplotlib-cheat-sheet\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.pickl.ai\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/11\\\/image9-1.png\",\"contentUrl\":\"https:\\\/\\\/www.pickl.ai\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/11\\\/image9-1.png\",\"width\":800,\"height\":500,\"caption\":\"A must-have Matplotlib cheat sheet for everyone.\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.pickl.ai\\\/blog\\\/matplotlib-cheat-sheet\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.pickl.ai\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python\",\"item\":\"https:\\\/\\\/www.pickl.ai\\\/blog\\\/category\\\/python\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"A Must-Have Matplotlib Cheat Sheet for Everyone\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.pickl.ai\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.pickl.ai\\\/blog\\\/\",\"name\":\"Pickl.AI\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.pickl.ai\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.pickl.ai\\\/blog\\\/#\\\/schema\\\/person\\\/0310c70c058fe2f3308f9210dc2af44c\",\"name\":\"Versha Rawat\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/pickl.ai\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/12\\\/avatar_user_19_1703676847-96x96.jpegc89aa37d48a23416a20dee319ca50fbb\",\"url\":\"https:\\\/\\\/pickl.ai\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/12\\\/avatar_user_19_1703676847-96x96.jpeg\",\"contentUrl\":\"https:\\\/\\\/pickl.ai\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/12\\\/avatar_user_19_1703676847-96x96.jpeg\",\"caption\":\"Versha Rawat\"},\"description\":\"I'm Versha Rawat, and I work as a Content Writer. I enjoy watching anime, movies, reading, and painting in my free time. I'm a curious person who loves learning new things.\",\"url\":\"https:\\\/\\\/www.pickl.ai\\\/blog\\\/author\\\/versha-rawat\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Matplotlib Cheat Sheet: Everything You Need to Know","description":"Explore this Matplotlib Cheat Sheet to learn how to install, create, customise, and save charts in Python. Enhance your skills.","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.pickl.ai\/blog\/matplotlib-cheat-sheet\/","og_locale":"en_US","og_type":"article","og_title":"A Must-Have Matplotlib Cheat Sheet for Everyone","og_description":"Explore this Matplotlib Cheat Sheet to learn how to install, create, customise, and save charts in Python. Enhance your skills.","og_url":"https:\/\/www.pickl.ai\/blog\/matplotlib-cheat-sheet\/","og_site_name":"Pickl.AI","article_published_time":"2023-11-09T10:33:09+00:00","article_modified_time":"2025-02-21T09:45:19+00:00","og_image":[{"width":800,"height":500,"url":"https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/11\/image9-1.png","type":"image\/png"}],"author":"Versha Rawat, Nitin Choudhary","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Versha Rawat","Est. reading time":"12 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.pickl.ai\/blog\/matplotlib-cheat-sheet\/#article","isPartOf":{"@id":"https:\/\/www.pickl.ai\/blog\/matplotlib-cheat-sheet\/"},"author":{"name":"Versha Rawat","@id":"https:\/\/www.pickl.ai\/blog\/#\/schema\/person\/0310c70c058fe2f3308f9210dc2af44c"},"headline":"A Must-Have Matplotlib Cheat Sheet for Everyone","datePublished":"2023-11-09T10:33:09+00:00","dateModified":"2025-02-21T09:45:19+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pickl.ai\/blog\/matplotlib-cheat-sheet\/"},"wordCount":1680,"commentCount":0,"image":{"@id":"https:\/\/www.pickl.ai\/blog\/matplotlib-cheat-sheet\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/11\/image9-1.png","keywords":["Matplotlib cheat sheet","matplotlib cheat sheet github","Matplotlib cheat sheet with examples","matplotlib in python"],"articleSection":["Python"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.pickl.ai\/blog\/matplotlib-cheat-sheet\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.pickl.ai\/blog\/matplotlib-cheat-sheet\/","url":"https:\/\/www.pickl.ai\/blog\/matplotlib-cheat-sheet\/","name":"Matplotlib Cheat Sheet: Everything You Need to Know","isPartOf":{"@id":"https:\/\/www.pickl.ai\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.pickl.ai\/blog\/matplotlib-cheat-sheet\/#primaryimage"},"image":{"@id":"https:\/\/www.pickl.ai\/blog\/matplotlib-cheat-sheet\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/11\/image9-1.png","datePublished":"2023-11-09T10:33:09+00:00","dateModified":"2025-02-21T09:45:19+00:00","author":{"@id":"https:\/\/www.pickl.ai\/blog\/#\/schema\/person\/0310c70c058fe2f3308f9210dc2af44c"},"description":"Explore this Matplotlib Cheat Sheet to learn how to install, create, customise, and save charts in Python. Enhance your skills.","breadcrumb":{"@id":"https:\/\/www.pickl.ai\/blog\/matplotlib-cheat-sheet\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pickl.ai\/blog\/matplotlib-cheat-sheet\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pickl.ai\/blog\/matplotlib-cheat-sheet\/#primaryimage","url":"https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/11\/image9-1.png","contentUrl":"https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/11\/image9-1.png","width":800,"height":500,"caption":"A must-have Matplotlib cheat sheet for everyone."},{"@type":"BreadcrumbList","@id":"https:\/\/www.pickl.ai\/blog\/matplotlib-cheat-sheet\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pickl.ai\/blog\/"},{"@type":"ListItem","position":2,"name":"Python","item":"https:\/\/www.pickl.ai\/blog\/category\/python\/"},{"@type":"ListItem","position":3,"name":"A Must-Have Matplotlib Cheat Sheet for Everyone"}]},{"@type":"WebSite","@id":"https:\/\/www.pickl.ai\/blog\/#website","url":"https:\/\/www.pickl.ai\/blog\/","name":"Pickl.AI","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.pickl.ai\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.pickl.ai\/blog\/#\/schema\/person\/0310c70c058fe2f3308f9210dc2af44c","name":"Versha Rawat","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/pickl.ai\/blog\/wp-content\/uploads\/2023\/12\/avatar_user_19_1703676847-96x96.jpegc89aa37d48a23416a20dee319ca50fbb","url":"https:\/\/pickl.ai\/blog\/wp-content\/uploads\/2023\/12\/avatar_user_19_1703676847-96x96.jpeg","contentUrl":"https:\/\/pickl.ai\/blog\/wp-content\/uploads\/2023\/12\/avatar_user_19_1703676847-96x96.jpeg","caption":"Versha Rawat"},"description":"I'm Versha Rawat, and I work as a Content Writer. I enjoy watching anime, movies, reading, and painting in my free time. I'm a curious person who loves learning new things.","url":"https:\/\/www.pickl.ai\/blog\/author\/versha-rawat\/"}]}},"jetpack_featured_media_url":"https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/11\/image9-1.png","authors":[{"term_id":2186,"user_id":19,"is_guest":0,"slug":"versha-rawat","display_name":"Versha Rawat","avatar_url":"https:\/\/pickl.ai\/blog\/wp-content\/uploads\/2023\/12\/avatar_user_19_1703676847-96x96.jpeg","first_name":"Versha","user_url":"","last_name":"Rawat","description":"I'm Versha Rawat, and I work as a Content Writer. I enjoy watching anime, movies, reading, and painting in my free time. I'm a curious person who loves learning new things."},{"term_id":2183,"user_id":18,"is_guest":0,"slug":"nitin-choudhary","display_name":"Nitin Choudhary","avatar_url":"https:\/\/pickl.ai\/blog\/wp-content\/uploads\/2023\/10\/avatar_user_18_1697616749-96x96.jpeg","first_name":"Nitin","user_url":"","last_name":"Choudhary","description":"I've been playing with data for a while now, and it's been pretty cool! I like turning all those numbers into pictures that tell stories. When I'm not doing that, I love running, meeting new people, and reading books. Running makes me feel great, meeting people is fun, and books are like my new favourite thing. It's not just about data; it's also about being active, making friends, and enjoying good stories. Come along and see how awesome the world of data can be!"}],"_links":{"self":[{"href":"https:\/\/www.pickl.ai\/blog\/wp-json\/wp\/v2\/posts\/5288","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pickl.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pickl.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pickl.ai\/blog\/wp-json\/wp\/v2\/users\/19"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pickl.ai\/blog\/wp-json\/wp\/v2\/comments?post=5288"}],"version-history":[{"count":6,"href":"https:\/\/www.pickl.ai\/blog\/wp-json\/wp\/v2\/posts\/5288\/revisions"}],"predecessor-version":[{"id":20103,"href":"https:\/\/www.pickl.ai\/blog\/wp-json\/wp\/v2\/posts\/5288\/revisions\/20103"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.pickl.ai\/blog\/wp-json\/wp\/v2\/media\/20102"}],"wp:attachment":[{"href":"https:\/\/www.pickl.ai\/blog\/wp-json\/wp\/v2\/media?parent=5288"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pickl.ai\/blog\/wp-json\/wp\/v2\/categories?post=5288"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pickl.ai\/blog\/wp-json\/wp\/v2\/tags?post=5288"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.pickl.ai\/blog\/wp-json\/wp\/v2\/ppma_author?post=5288"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}