{"id":192478,"date":"2023-06-26T11:04:35","date_gmt":"2023-06-26T15:04:35","guid":{"rendered":"https:\/\/ibkrcampus.com\/?p=192478"},"modified":"2024-05-17T15:30:58","modified_gmt":"2024-05-17T19:30:58","slug":"python-matplotlib-tutorial-plotting-data-and-customisation-part-i","status":"publish","type":"post","link":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/python-matplotlib-tutorial-plotting-data-and-customisation-part-i\/","title":{"rendered":"Python Matplotlib Tutorial: Plotting Data And Customisation &#8211; Part I"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Python is known to be the most popular programming language today \u207d<a href=\"https:\/\/www.infoworld.com\/article\/3669232\/python-popularity-still-soaring.html\">\u00b9<\/a>\u207e. Further, Python Matplotlib is a way of visualising the data. It is quite essential to have accessible ways to view and understand the data\u2019s impact with the help of graphs or plots.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Let us now learn more about visualising data with Python Matplotlib with this blog that covers:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>What is Python Matplotlib?<\/li>\n\n\n\n<li>Why do we need data visualisation?<\/li>\n\n\n\n<li>Basic terms and concepts in Matplotlib<\/li>\n\n\n\n<li>Plotting data in Python Matplotlib<\/li>\n\n\n\n<li>Plot customization using Python Matplotlib<\/li>\n\n\n\n<li>Multiple plots using Python Matplotlib<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"what-is-python-matplotlib\">What is Python Matplotlib?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Matplotlib is a popular Python library that can be used to create data visualisations quite easily. It is probably the single most used Python package for 2D graphics along with limited support for 3D graphics.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It provides both a rapid way to visualise data from Python and publication-quality figures in many formats. Also, It was designed from the beginning to serve two purposes:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Allow for interactive, cross-platform control of figures and plots<\/li>\n\n\n\n<li>Make it easy to produce static vector graphics files without the need for any GUIs.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">Much like Python itself, Matplotlib gives developers complete control over the appearance of their plots. It tries to make easy things easy and hard things possible. We can generate plots, histograms, power spectra, bar charts, error charts, scatter plots, etc., with just a few lines of code.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For simple plotting, the pyplot module within the matplotlib package provides a MATLAB-like interface to the underlying object-oriented plotting library. It implicitly and automatically creates figures and axes to achieve the desired plot.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For importing Python matplotlib you simply need to first install matplotlib and then import the same by using these commands-<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">pip install matplotlib<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/gist.github.com\/quantra-go-algo\/d0a345b50d2b034a0a1a0c43a21fd515#file-install_matplotlib-py\">Install_matplotlib.py&nbsp;<\/a>hosted with \u2764 by&nbsp;<a href=\"https:\/\/github.com\/\">GitHub<\/a><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">import matplotlib<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/gist.github.com\/quantra-go-algo\/3fee400693d2416449ec15f63b4a22fa#file-import_matplotlib-py\">Import_matplotlib.py&nbsp;<\/a>hosted with \u2764 by&nbsp;<a href=\"https:\/\/github.com\/\">GitHub<\/a><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"why-do-we-need-data-visualisation\">Why do we need data visualisation?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The importance of data visualisation is simple: it helps people see, interact with, and better understand data. Whether simple or complex, the right visualisation can bring everyone on the same page, regardless of their level of expertise.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It\u2019s hard to think of a professional industry that doesn\u2019t benefit from making data more understandable \u207d<a href=\"https:\/\/www.forbes.com\/sites\/jeffkauflin\/2017\/07\/20\/the-five-most-in-demand-skills-for-data-analysis-jobs\/\">\u00b2<\/a>\u207e. Every STEM field benefits from understanding data\u2014and so do fields in government, finance, marketing, history, consumer goods, service industries, education, sports, and so on.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">While we\u2019ll always wax poetically about data visualisation (you\u2019re on the Tableau website, after all), there are practical, real-life applications that are undeniable. And, since visualisation is so prolific, it\u2019s also one of the most useful professional skills to develop. The better you can convey your points visually, whether in a dashboard or a slide deck, the better you can leverage that information.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">As the skill sets are changing to accommodate a data-driven world, it is increasingly valuable for professionals to be able to use data to make decisions. Moreover, the visuals help to tell the detailed stories of the who, what, when, where, and how.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">While traditional education typically draws a distinct line between creative storytelling and technical analysis, the modern professional world also values those who can cross between the two: data visualisation sits right in the middle of analysis and visual storytelling.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"basic-terms-and-concepts-in-matplotlib\">Basic terms and concepts in Matplotlib<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Python Matplotlib allows creating a wide variety of plots and graphs. Matplotlib is a large project and can seem daunting at first. However, we will start learning the components, and it should feel much smaller and approachable.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Different sources use &#8216;plot&#8217; to mean different things. So let us begin by defining specific terminology used across the domain.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Figure is the top-level container in the hierarchy. It is the overall window where everything is drawn. We can have multiple independent figures, and each figure can have multiple Axes. It can be created using the figure method of pyplot module.<\/li>\n\n\n\n<li>Axes is where the plotting occurs. The axes are effectively the area that we plot data on. Each Axes has an X-Axis and a Y-Axis.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The example mentioned below illustrates the use of the above-mentioned terms:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">fig = plt.figure()<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/gist.github.com\/quantra-go-algo\/a1bed56e6891c6a1636050e83eb80b7a#file-fig-py\">Fig.py&nbsp;<\/a>hosted with \u2764 by&nbsp;<a href=\"https:\/\/github.com\/\">GitHub<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Upon running the above example, nothing happens really. It only creates a figure of size 432 x 288 with 0 Axes. Also, Python Matplotlib will not show anything until told to do so. Python will wait for a call-to-show method to display the plot.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This is because we might want to add some extra features to the plot before displaying it, such as title and label customisation. Hence, we need to call plt.show() method to show the figure as shown below:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">plt.show()<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/gist.github.com\/quantra-go-algo\/79878ebbb1d9ba28dc714749abaed1e3#file-show-py\">Show.py&nbsp;<\/a>hosted with \u2764 by&nbsp;<a href=\"https:\/\/github.com\/\">GitHub<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">As there is nothing to plot, there will be no output. While we are on the topic, we can control the size of the figure through the figsize argument, which expects a tuple of (width, height) in inches.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">fig = plt.figure(figsize=(8, 4))\nplt.show()<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/gist.github.com\/quantra-go-algo\/ed4bd398eb32c19cd0cc4e975868101d#file-fig_size-py\">Fig_size.py&nbsp;<\/a>hosted with \u2764 by&nbsp;<a href=\"https:\/\/github.com\/\">GitHub<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"axes\">Axes<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">All plotting is done concerning an Axes. An Axes is made up of Axis objects and many other things. An Axes object must belong to a Figure. Most commands that we will ever issue in Python Matplotlib will be concerning this Axes object.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Typically, we will set up a Figure, and then add Axes on to it. We can use&nbsp;<code>fig.add_axes<\/code>&nbsp;but in most cases, we find that adding a subplot fits our need perfectly. A subplot is an axes on a grid system.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>add_subplot<\/code>&nbsp;method adds an Axes to the figure as part of a subplot arrangement.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># Creating figure\nfig = plt.figure()\n# Creating subplot\nax = fig.add_subplot(111) # Subplot with 1 row and 1 column at the index 1\nplt.show()<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/gist.github.com\/quantra-go-algo\/4dee7ff8a6b77df828bef199d9a66d32#file-subplot-py\">Subplot.py&nbsp;<\/a>hosted with \u2764 by&nbsp;<a href=\"https:\/\/github.com\/\">GitHub<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Figure 1<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"380\" height=\"252\" data-src=\"\/campus\/wp-content\/uploads\/sites\/2\/2023\/06\/figure_1-quantinsti.png\" alt=\"\" class=\"wp-image-192484 lazyload\" data-srcset=\"https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/06\/figure_1-quantinsti.png 380w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/06\/figure_1-quantinsti-300x199.png 300w\" data-sizes=\"(max-width: 380px) 100vw, 380px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 380px; aspect-ratio: 380\/252;\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The above code adds a single plot to the figure fig with the help of the<code>add_subplot<\/code>&nbsp;method.The output we get is a blank plot with axes ranging from 0 to 1, as shown above.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In Python Matplotlib, we can customise the plot using a few more built-in methods. Let us add the title, X-axis label, and Y-axis label, and set the limit range on both axes. This is illustrated in the below code snippet.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">fig = plt.figure()\n# Creating subplot\/axes\nax = fig.add_subplot(111)\n\n# Setting axes\/plot title\nax.set_title('An Axes Title')\n\n# Setting X-axis and Y-axis limits\nax.set_xlim([0.5, 4.5])\nax.set_ylim([-3, 7])\n\n# Setting X-axis and Y-axis labels\nax.set_ylabel('Y-Axis Label')\nax.set_xlabel('X-Axis Label')\n\n# Showing the plot\nplt.show()<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/gist.github.com\/quantra-go-algo\/f8faf4e53781402559169192fa4bc099#file-customise_subplot-py\">Customise_subplot.py&nbsp;<\/a>hosted with \u2764 by&nbsp;<a href=\"https:\/\/github.com\/\">GitHub<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Figure 2<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"392\" height=\"278\" data-src=\"\/campus\/wp-content\/uploads\/sites\/2\/2023\/06\/figure_2-quantinsti.png\" alt=\"\" class=\"wp-image-192485 lazyload\" data-srcset=\"https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/06\/figure_2-quantinsti.png 392w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/06\/figure_2-quantinsti-300x213.png 300w\" data-sizes=\"(max-width: 392px) 100vw, 392px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 392px; aspect-ratio: 392\/278;\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Python Matplotlib&#8217;s objects typically have lots of explicit setters, i.e. methods that start with&nbsp;<code>set_something<\/code>&nbsp;and control a particular option. Setting each option using explicit setters becomes repetitive, and hence we can set all required parameters directly on the axes using the set method as illustrated below:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">fig = plt.figure()\n\n# Creating subplot\/axes\nax = fig.add_subplot(111)\n\n# Setting title and axes properties\nax.set(title='An Axes Title', xlim=[0.5, 4.5], ylim=[-3, 7], ylabel='Y-Axis Label', xlabel='X-Axis Label')\nplt.show()<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/gist.github.com\/quantra-go-algo\/3243974b18ac01280c9e6d8f1a1c3231#file-set_parameters-py\">Set_parameters.py&nbsp;<\/a>hosted with \u2764 by&nbsp;<a href=\"https:\/\/github.com\/\">GitHub<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The set method does not apply to Axes; it applies to more-or-less all Python Matplotlib objects.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The above code snippet has the same output as figure 2 above using the set method with all required parameters passed as arguments to it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>Stay tuned for the next installment to learn about Axes method v\/s Pyplot<\/em>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>Originally posted on <a href=\"https:\/\/blog.quantinsti.com\/python-matplotlib-tutorial\/\">QuantInsti<\/a> blog.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Let us now learn more about visualising data with Python Matplotlib.<\/p>\n","protected":false},"author":186,"featured_media":189058,"comment_status":"open","ping_status":"closed","sticky":true,"template":"","format":"standard","meta":{"_acf_changed":true,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[339,343,349,338,341],"tags":[806,5479,4659,595],"contributors-categories":[13654],"class_list":["post-192478","post","type-post","status-publish","format-standard","has-post-thumbnail","category-data-science","category-programing-languages","category-python-development","category-ibkr-quant-news","category-quant-development","tag-data-science","tag-data-visualisation","tag-matplotlib","tag-python","contributors-categories-quantinsti"],"pp_statuses_selecting_workflow":false,"pp_workflow_action":"current","pp_status_selection":"publish","acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.9 (Yoast SEO v28.1) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Python Matplotlib Tutorial: Plotting Data And Customisation &#8211; Part I<\/title>\n<meta name=\"description\" content=\"Let us now learn more about visualising data with Python Matplotlib.\" \/>\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.interactivebrokers.com\/campus\/wp-json\/wp\/v2\/posts\/192478\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python Matplotlib Tutorial: Plotting Data And Customisation - Part I | IBKR Campus US\" \/>\n<meta property=\"og:description\" content=\"Let us now learn more about visualising data with Python Matplotlib.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/python-matplotlib-tutorial-plotting-data-and-customisation-part-i\/\" \/>\n<meta property=\"og:site_name\" content=\"IBKR Campus US\" \/>\n<meta property=\"article:published_time\" content=\"2023-06-26T15:04:35+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-05-17T19:30:58+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/04\/python-high-level-programming.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"563\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Contributor Author\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Contributor Author\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\n\t    \"@context\": \"https:\\\/\\\/schema.org\",\n\t    \"@graph\": [\n\t        {\n\t            \"@type\": \"NewsArticle\",\n\t            \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/python-matplotlib-tutorial-plotting-data-and-customisation-part-i\\\/#article\",\n\t            \"isPartOf\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/python-matplotlib-tutorial-plotting-data-and-customisation-part-i\\\/\"\n\t            },\n\t            \"author\": {\n\t                \"name\": \"Contributor Author\",\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/person\\\/e823e46b42ca381080387e794318a485\"\n\t            },\n\t            \"headline\": \"Python Matplotlib Tutorial: Plotting Data And Customisation &#8211; Part I\",\n\t            \"datePublished\": \"2023-06-26T15:04:35+00:00\",\n\t            \"dateModified\": \"2024-05-17T19:30:58+00:00\",\n\t            \"mainEntityOfPage\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/python-matplotlib-tutorial-plotting-data-and-customisation-part-i\\\/\"\n\t            },\n\t            \"wordCount\": 1137,\n\t            \"commentCount\": 0,\n\t            \"publisher\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#organization\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/python-matplotlib-tutorial-plotting-data-and-customisation-part-i\\\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/04\\\/python-high-level-programming.jpg\",\n\t            \"keywords\": [\n\t                \"Data Science\",\n\t                \"Data Visualisation\",\n\t                \"Matplotlib\",\n\t                \"Python\"\n\t            ],\n\t            \"articleSection\": [\n\t                \"Data Science\",\n\t                \"Programming Languages\",\n\t                \"Python Development\",\n\t                \"Quant\",\n\t                \"Quant Development\"\n\t            ],\n\t            \"inLanguage\": \"en-US\",\n\t            \"potentialAction\": [\n\t                {\n\t                    \"@type\": \"CommentAction\",\n\t                    \"name\": \"Comment\",\n\t                    \"target\": [\n\t                        \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/python-matplotlib-tutorial-plotting-data-and-customisation-part-i\\\/#respond\"\n\t                    ]\n\t                }\n\t            ]\n\t        },\n\t        {\n\t            \"@type\": \"WebPage\",\n\t            \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/python-matplotlib-tutorial-plotting-data-and-customisation-part-i\\\/\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/python-matplotlib-tutorial-plotting-data-and-customisation-part-i\\\/\",\n\t            \"name\": \"Python Matplotlib Tutorial: Plotting Data And Customisation - Part I | IBKR Campus US\",\n\t            \"isPartOf\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#website\"\n\t            },\n\t            \"primaryImageOfPage\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/python-matplotlib-tutorial-plotting-data-and-customisation-part-i\\\/#primaryimage\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/python-matplotlib-tutorial-plotting-data-and-customisation-part-i\\\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/04\\\/python-high-level-programming.jpg\",\n\t            \"datePublished\": \"2023-06-26T15:04:35+00:00\",\n\t            \"dateModified\": \"2024-05-17T19:30:58+00:00\",\n\t            \"description\": \"Let us now learn more about visualising data with Python Matplotlib.\",\n\t            \"inLanguage\": \"en-US\",\n\t            \"potentialAction\": [\n\t                {\n\t                    \"@type\": \"ReadAction\",\n\t                    \"target\": [\n\t                        \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/python-matplotlib-tutorial-plotting-data-and-customisation-part-i\\\/\"\n\t                    ]\n\t                }\n\t            ]\n\t        },\n\t        {\n\t            \"@type\": \"ImageObject\",\n\t            \"inLanguage\": \"en-US\",\n\t            \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/python-matplotlib-tutorial-plotting-data-and-customisation-part-i\\\/#primaryimage\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/04\\\/python-high-level-programming.jpg\",\n\t            \"contentUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/04\\\/python-high-level-programming.jpg\",\n\t            \"width\": 1000,\n\t            \"height\": 563,\n\t            \"caption\": \"Python\"\n\t        },\n\t        {\n\t            \"@type\": \"WebSite\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#website\",\n\t            \"url\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/\",\n\t            \"name\": \"IBKR Campus US\",\n\t            \"description\": \"Financial Education from Interactive Brokers\",\n\t            \"publisher\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#organization\"\n\t            },\n\t            \"potentialAction\": [\n\t                {\n\t                    \"@type\": \"SearchAction\",\n\t                    \"target\": {\n\t                        \"@type\": \"EntryPoint\",\n\t                        \"urlTemplate\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/?s={search_term_string}\"\n\t                    },\n\t                    \"query-input\": {\n\t                        \"@type\": \"PropertyValueSpecification\",\n\t                        \"valueRequired\": true,\n\t                        \"valueName\": \"search_term_string\"\n\t                    }\n\t                }\n\t            ],\n\t            \"inLanguage\": \"en-US\"\n\t        },\n\t        {\n\t            \"@type\": \"Organization\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#organization\",\n\t            \"name\": \"Interactive Brokers\",\n\t            \"alternateName\": \"IBKR\",\n\t            \"url\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/\",\n\t            \"logo\": {\n\t                \"@type\": \"ImageObject\",\n\t                \"inLanguage\": \"en-US\",\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/logo\\\/image\\\/\",\n\t                \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2024\\\/05\\\/ibkr-campus-logo.jpg\",\n\t                \"contentUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2024\\\/05\\\/ibkr-campus-logo.jpg\",\n\t                \"width\": 669,\n\t                \"height\": 669,\n\t                \"caption\": \"Interactive Brokers\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/logo\\\/image\\\/\"\n\t            },\n\t            \"publishingPrinciples\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/about-ibkr-campus\\\/\",\n\t            \"ethicsPolicy\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/cyber-security-notice\\\/\"\n\t        },\n\t        {\n\t            \"@type\": \"Person\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/person\\\/e823e46b42ca381080387e794318a485\",\n\t            \"name\": \"Contributor Author\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/author\\\/contributor-author\\\/\"\n\t        }\n\t    ]\n\t}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Python Matplotlib Tutorial: Plotting Data And Customisation &#8211; Part I","description":"Let us now learn more about visualising data with Python Matplotlib.","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.interactivebrokers.com\/campus\/wp-json\/wp\/v2\/posts\/192478\/","og_locale":"en_US","og_type":"article","og_title":"Python Matplotlib Tutorial: Plotting Data And Customisation - Part I | IBKR Campus US","og_description":"Let us now learn more about visualising data with Python Matplotlib.","og_url":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/python-matplotlib-tutorial-plotting-data-and-customisation-part-i\/","og_site_name":"IBKR Campus US","article_published_time":"2023-06-26T15:04:35+00:00","article_modified_time":"2024-05-17T19:30:58+00:00","og_image":[{"width":1000,"height":563,"url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/04\/python-high-level-programming.jpg","type":"image\/jpeg"}],"author":"Contributor Author","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Contributor Author","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"NewsArticle","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/python-matplotlib-tutorial-plotting-data-and-customisation-part-i\/#article","isPartOf":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/python-matplotlib-tutorial-plotting-data-and-customisation-part-i\/"},"author":{"name":"Contributor Author","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/person\/e823e46b42ca381080387e794318a485"},"headline":"Python Matplotlib Tutorial: Plotting Data And Customisation &#8211; Part I","datePublished":"2023-06-26T15:04:35+00:00","dateModified":"2024-05-17T19:30:58+00:00","mainEntityOfPage":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/python-matplotlib-tutorial-plotting-data-and-customisation-part-i\/"},"wordCount":1137,"commentCount":0,"publisher":{"@id":"https:\/\/ibkrcampus.com\/campus\/#organization"},"image":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/python-matplotlib-tutorial-plotting-data-and-customisation-part-i\/#primaryimage"},"thumbnailUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/04\/python-high-level-programming.jpg","keywords":["Data Science","Data Visualisation","Matplotlib","Python"],"articleSection":["Data Science","Programming Languages","Python Development","Quant","Quant Development"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/python-matplotlib-tutorial-plotting-data-and-customisation-part-i\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/python-matplotlib-tutorial-plotting-data-and-customisation-part-i\/","url":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/python-matplotlib-tutorial-plotting-data-and-customisation-part-i\/","name":"Python Matplotlib Tutorial: Plotting Data And Customisation - Part I | IBKR Campus US","isPartOf":{"@id":"https:\/\/ibkrcampus.com\/campus\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/python-matplotlib-tutorial-plotting-data-and-customisation-part-i\/#primaryimage"},"image":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/python-matplotlib-tutorial-plotting-data-and-customisation-part-i\/#primaryimage"},"thumbnailUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/04\/python-high-level-programming.jpg","datePublished":"2023-06-26T15:04:35+00:00","dateModified":"2024-05-17T19:30:58+00:00","description":"Let us now learn more about visualising data with Python Matplotlib.","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/python-matplotlib-tutorial-plotting-data-and-customisation-part-i\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/python-matplotlib-tutorial-plotting-data-and-customisation-part-i\/#primaryimage","url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/04\/python-high-level-programming.jpg","contentUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/04\/python-high-level-programming.jpg","width":1000,"height":563,"caption":"Python"},{"@type":"WebSite","@id":"https:\/\/ibkrcampus.com\/campus\/#website","url":"https:\/\/ibkrcampus.com\/campus\/","name":"IBKR Campus US","description":"Financial Education from Interactive Brokers","publisher":{"@id":"https:\/\/ibkrcampus.com\/campus\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ibkrcampus.com\/campus\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/ibkrcampus.com\/campus\/#organization","name":"Interactive Brokers","alternateName":"IBKR","url":"https:\/\/ibkrcampus.com\/campus\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/logo\/image\/","url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/05\/ibkr-campus-logo.jpg","contentUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/05\/ibkr-campus-logo.jpg","width":669,"height":669,"caption":"Interactive Brokers"},"image":{"@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/logo\/image\/"},"publishingPrinciples":"https:\/\/www.interactivebrokers.com\/campus\/about-ibkr-campus\/","ethicsPolicy":"https:\/\/www.interactivebrokers.com\/campus\/cyber-security-notice\/"},{"@type":"Person","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/person\/e823e46b42ca381080387e794318a485","name":"Contributor Author","url":"https:\/\/www.interactivebrokers.com\/campus\/author\/contributor-author\/"}]}},"jetpack_featured_media_url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/04\/python-high-level-programming.jpg","_links":{"self":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts\/192478","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/users\/186"}],"replies":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/comments?post=192478"}],"version-history":[{"count":0,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts\/192478\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/media\/189058"}],"wp:attachment":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/media?parent=192478"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/categories?post=192478"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/tags?post=192478"},{"taxonomy":"contributors-categories","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/contributors-categories?post=192478"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}