{"id":447190,"date":"2024-06-24T18:00:30","date_gmt":"2024-06-24T12:30:30","guid":{"rendered":"https:\/\/techvidvan.com\/tutorials\/?p=447190"},"modified":"2024-06-24T18:16:35","modified_gmt":"2024-06-24T12:46:35","slug":"numpy-matpotlib","status":"publish","type":"post","link":"https:\/\/techvidvan.com\/tutorials\/numpy-matpotlib\/","title":{"rendered":"NumPy Matpotlib &#8211; Data Visualization Plot"},"content":{"rendered":"<p>If you&#8217;re looking to create stunning visualizations and plots in Python, Matplotlib is your go-to library. Whether you&#8217;re a data scientist, engineer, or just someone who wants to visualize data, Matplotlib provides a powerful toolset.<\/p>\n<p>In this beginner-friendly guide, we&#8217;ll explore the basics of Matplotlib, its integration with NumPy, and how to create various types of plots.<\/p>\n<h2>What is Matplotlib?<\/h2>\n<p>Matplotlib is a Python library that makes it easy to create graphs and charts. It can be used to visualize data in many different ways, such as line plots, scatter plots, bar plots, and histograms. Matplotlib also supports 2D and 3D plots. It was originally developed by John D. Hunter and is currently maintained by Michael Droettboom. Matplotlib is an open-source alternative to MATLAB and can be integrated seamlessly with libraries like NumPy, PyQt, and wxPython.<\/p>\n<h3>Creating Your First Plot<\/h3>\n<p>Let&#8217;s start with a simple example. Suppose you want to plot the equation y = 2x + 5. Here&#8217;s how you can do it using Matplotlib and NumPy:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import numpy as np\r\nfrom matplotlib import pyplot as plt\r\n\r\nx = np.arange(1, 11)  # Create an array from 1 to 10\r\ny = 2 * x + 5\r\n\r\nplt.title(\"Matplotlib Demo\")\r\nplt.xlabel(\"X-axis Caption\")\r\nplt.ylabel(\"Y-axis Caption\")\r\nplt.plot(x, y)  # Plot the data points\r\nplt.show()       # Display the plot<\/pre>\n<h4>In this code:<\/h4>\n<ul>\n<li>We import NumPy as np for numerical operations.<\/li>\n<li>We create an array x using np.arange() to represent the x-axis values from 1 to 10.<\/li>\n<li>We calculate the corresponding y-axis values and store them in the y array.<\/li>\n<li>We set the title and labels for the x and y axes.<\/li>\n<li>We use plt.plot() to create a line plot with x and y as data points.<\/li>\n<li>Finally, we use plt.show() to display the plot.<\/li>\n<li>Running this code will generate a plot of a straight line with the equation y = 2x + 5.<\/li>\n<\/ul>\n<p><strong>Output:<\/strong><\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/04\/matplotlip-demo.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-447415 size-full\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/04\/matplotlip-demo.webp\" alt=\"matplotlip demo\" width=\"608\" height=\"463\" \/><\/a><\/p>\n<h3>Customizing Your Plot<\/h3>\n<p>Matplotlib offers extensive customization options to make your plots visually appealing. You can change line styles, markers, colors, and more. Here are some common customization options:<\/p>\n<table>\n<tbody>\n<tr>\n<td><strong>SR.NO.<\/strong><\/td>\n<td><strong>CHARACTER &amp; DESCRIPTION<\/strong><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">1<\/span><\/td>\n<td><span style=\"font-weight: 400;\">-&#8216;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Solid line style<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">2<\/span><\/td>\n<td><span style=\"font-weight: 400;\">&#8211;&#8216;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Dashed line style<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">3<\/span><\/td>\n<td><span style=\"font-weight: 400;\">-.&#8217;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Dash-dot line style<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">4<\/span><\/td>\n<td><span style=\"font-weight: 400;\">:&#8217;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Dotted line style<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">5<\/span><\/td>\n<td><span style=\"font-weight: 400;\">.&#8217;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Point marker<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">6<\/span><\/td>\n<td><span style=\"font-weight: 400;\">,&#8217;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Pixel marker<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">7<\/span><\/td>\n<td><span style=\"font-weight: 400;\">o&#8217;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Circle marker<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">8<\/span><\/td>\n<td><span style=\"font-weight: 400;\">v&#8217;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Triangle_down marker<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">9<\/span><\/td>\n<td><span style=\"font-weight: 400;\">^&#8217;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Triangle_up marker<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">10<\/span><\/td>\n<td><span style=\"font-weight: 400;\">&lt;&#8216;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Triangle_left marker<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">11<\/span><\/td>\n<td><span style=\"font-weight: 400;\">&gt;&#8217;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Triangle_right marker<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">12<\/span><\/td>\n<td><span style=\"font-weight: 400;\">1&#8242;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Tri_down marker<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">13<\/span><\/td>\n<td><span style=\"font-weight: 400;\">2&#8242;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Tri_up marker<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">14<\/span><\/td>\n<td><span style=\"font-weight: 400;\">3&#8242;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Tri_left marker<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">15<\/span><\/td>\n<td><span style=\"font-weight: 400;\">4&#8242;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Tri_right marker<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">16<\/span><\/td>\n<td><span style=\"font-weight: 400;\">s&#8217;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Square marker<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">17<\/span><\/td>\n<td><span style=\"font-weight: 400;\">p&#8217;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Pentagon marker<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">18<\/span><\/td>\n<td><span style=\"font-weight: 400;\">*&#8217;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Star marker<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">19<\/span><\/td>\n<td><span style=\"font-weight: 400;\">h&#8217;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Hexagon1 marker<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">20<\/span><\/td>\n<td><span style=\"font-weight: 400;\">H&#8217;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Hexagon2 marker<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">21<\/span><\/td>\n<td><span style=\"font-weight: 400;\">+&#8217;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Plus marker<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">22<\/span><\/td>\n<td><span style=\"font-weight: 400;\">x&#8217;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">X marker<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">23<\/span><\/td>\n<td><span style=\"font-weight: 400;\">D&#8217;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Diamond marker<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">24<\/span><\/td>\n<td><span style=\"font-weight: 400;\">d&#8217;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Thin_diamond marker<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">25<\/span><\/td>\n<td><span style=\"font-weight: 400;\">|&#8217;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Vline marker<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">26<\/span><\/td>\n<td><span style=\"font-weight: 400;\">_&#8217;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Hline marker<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<table>\n<tbody>\n<tr>\n<td><strong>CHARACTER<\/strong><\/td>\n<td><strong>COLOR<\/strong><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">b&#8217;<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Blue<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">g&#8217;<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Green<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">r&#8217;<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Red<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">c&#8217;<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Cyan<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">m&#8217;<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Magenta<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">y&#8217;<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Yellow<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">k&#8217;<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Black<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">w&#8217;<\/span><\/td>\n<td><span style=\"font-weight: 400;\">White<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>You can combine these options to create unique plots. For example, to plot a red dashed line with square markers, you can modify the plt.plot() line as follows:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">plt.plot(x, y, 'r--s')<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/04\/customizing-your-plot.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-447429 size-full\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/04\/customizing-your-plot.webp\" alt=\"customizing your plot\" width=\"570\" height=\"495\" \/><\/a><\/p>\n<p>Now, let&#8217;s explore more types of plots you can create with Matplotlib.<\/p>\n<h3>Sine Wave Plot<\/h3>\n<p>The following script produces a sine wave plot using Matplotlib:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import numpy as np\r\nimport matplotlib.pyplot as plt\r\n\r\n# Compute the x and y coordinates for points on a sine curve\r\nx = np.arange(0, 3 * np.pi, 0.1)\r\ny = np.sin(x)\r\n\r\nplt.title(\"Sine Wave Form\")\r\nplt.plot(x, y)\r\nplt.show()<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/04\/sine-wave-plot.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-447430\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/04\/sine-wave-plot.webp\" alt=\"sine wave plot\" width=\"637\" height=\"431\" \/><\/a><\/p>\n<h3>Subplots<\/h3>\n<p>Matplotlib allows you to create multiple plots within the same figure using the subplot() function. This can be useful for comparing different data sets or for showing different aspects of the same data set.<\/p>\n<p><strong>The following script plots sine and cosine values side by side using the subplot() function:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import numpy as np\r\nimport matplotlib.pyplot as plt\r\n\r\n# Compute the x and y coordinates for points on sine and cosine curves\r\nx = np.arange(0, 3 * np.pi, 0.1)\r\ny_sin = np.sin(x)\r\ny_cos = np.cos(x)\r\n\r\n# Set up a subplot grid with 2 rows and 1 column,\r\n# and set the first subplot as active.\r\nplt.subplot(2, 1, 1)\r\n\r\n# Make the first plot (Sine)\r\nplt.plot(x, y_sin)\r\nplt.title('Sine')\r\n\r\n# Set the second subplot as active, and make the second plot (Cosine).\r\nplt.subplot(2, 1, 2)\r\nplt.plot(x, y_cos)\r\nplt.title('Cosine')\r\n\r\n# Show the figure with both subplots.\r\nplt.show()<\/pre>\n<p>Here, we create a grid of subplots with 2 rows and 1 column. We then plot the sine and cosine curves in separate subplots.<\/p>\n<p><strong>Output:<\/strong><\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/04\/subplots.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-447416\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/04\/subplots.webp\" alt=\"subplots\" width=\"599\" height=\"433\" \/><\/a><\/p>\n<h3>Bar Graphs<\/h3>\n<p>Matplotlib&#8217;s pyplot submodule provides the bar() function to generate bar graphs. In the following example, we create a bar graph with two sets of x and y arrays:<\/p>\n<p>from matplotlib import pyplot as plt<\/p>\n<p>x = [5, 8, 10]<br \/>\ny = [12, 16, 6]<br \/>\nx2 = [6, 9, 11]<br \/>\ny2 = [6, 15, 7]<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">plt.bar(x, y, align='center')\r\nplt.bar(x2, y2, color='g', align='center')\r\nplt.title('Bar Graph')\r\nplt.ylabel('Y-axis')\r\nplt.xlabel('X-axis')\r\nplt.show()<\/pre>\n<p>Running this code will produce a bar graph with two sets of bars, one in the default color and the other in green, demonstrating how to customize your bar graphs.<\/p>\n<p><strong>Output:<\/strong><\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/04\/bar-graphs.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-447417\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/04\/bar-graphs.webp\" alt=\"bar graphs\" width=\"626\" height=\"463\" \/><\/a><\/p>\n<h3>Histogram<\/h3>\n<p>The following code snippet visualizes the distribution of the data with 20 bins and displays it in green color.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import numpy as np\r\nimport matplotlib.pyplot as plt\r\n\r\n# Sample data for histogram\r\ndata_histogram = np.random.randn(1000)\r\n\r\n# Create a histogram\r\nplt.figure(figsize=(8, 6))\r\nplt.hist(data_histogram, bins=20, color='green', alpha=0.7, edgecolor='black')\r\nplt.title('Histogram Example')\r\nplt.xlabel('Value')\r\nplt.ylabel('Frequency')\r\nplt.grid(True)\r\n\r\n# Display the histogram\r\nplt.show()<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/04\/histogram.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-447418 size-full\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/04\/histogram.webp\" alt=\"histogram\" width=\"605\" height=\"402\" \/><\/a><\/p>\n<h3>Scatterplot<\/h3>\n<p>The following code is an example of creating Scatter Plots using Matplotlib<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import numpy as np\r\nimport matplotlib.pyplot as plt\r\n\r\n# Sample data for scatterplot\r\nx_scatter = np.random.rand(50)\r\ny_scatter = np.random.rand(50)\r\n\r\n# Create a scatterplot\r\nplt.figure(figsize=(8, 6))\r\nplt.scatter(x_scatter, y_scatter, color='blue', label='Scatterplot')\r\nplt.title('Scatterplot Example')\r\nplt.xlabel('X-axis')\r\nplt.ylabel('Y-axis')\r\nplt.legend()\r\nplt.grid(True)\r\n\r\n# Display the scatterplot\r\nplt.show()<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/04\/scatterplot.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-447431\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/04\/scatterplot.webp\" alt=\"scatterplot \" width=\"567\" height=\"394\" \/><\/a><\/p>\n<h3>Conclusion<\/h3>\n<p>NumPy and Matplotlib are two of the most popular Python libraries for numerical computing and data visualization. By using these two libraries together, you can efficiently perform complex calculations and create informative and visually appealing plots.<\/p>\n<p>In this blog post, we covered some of the most commonly used features of NumPy and Matplotlib. With NumPy and Matplotlib, you have the power to perform complex numerical computations and create informative and visually appealing plots. We encourage you to explore these libraries and use them to solve your own data science challenges. Happy Coding!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you&#8217;re looking to create stunning visualizations and plots in Python, Matplotlib is your go-to library. Whether you&#8217;re a data scientist, engineer, or just someone who wants to visualize data, Matplotlib provides a powerful&#46;&#46;&#46;<\/p>\n","protected":false},"author":6,"featured_media":447525,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[385],"tags":[383,5618,5617,5247,5616,5654,5615,384,5581],"class_list":["post-447190","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-numpy-tutorials","tag-learn-numpy","tag-matplotlib-and-numpy","tag-matpotlib","tag-numpy","tag-numpy-and-matpotlib","tag-numpy-matplotlib-for-data-visualization","tag-numpy-matpotlib","tag-numpy-tutorial","tag-numpy-tutorial-for-beginners"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>NumPy Matpotlib - Data Visualization Plot - TechVidvan<\/title>\n<meta name=\"description\" content=\"With NumPy and Matplotlib, you have the power to perform complex numerical computations and create informative and visually appealing plots.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/techvidvan.com\/tutorials\/numpy-matpotlib\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"NumPy Matpotlib - Data Visualization Plot - TechVidvan\" \/>\n<meta property=\"og:description\" content=\"With NumPy and Matplotlib, you have the power to perform complex numerical computations and create informative and visually appealing plots.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/techvidvan.com\/tutorials\/numpy-matpotlib\/\" \/>\n<meta property=\"og:site_name\" content=\"TechVidvan\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/TechVidvan\/\" \/>\n<meta property=\"article:published_time\" content=\"2024-06-24T12:30:30+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-06-24T12:46:35+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/06\/numPy-matplotlib.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"TechVidvan Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@vidvantech\" \/>\n<meta name=\"twitter:site\" content=\"@vidvantech\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"TechVidvan Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"NumPy Matpotlib - Data Visualization Plot - TechVidvan","description":"With NumPy and Matplotlib, you have the power to perform complex numerical computations and create informative and visually appealing plots.","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:\/\/techvidvan.com\/tutorials\/numpy-matpotlib\/","og_locale":"en_US","og_type":"article","og_title":"NumPy Matpotlib - Data Visualization Plot - TechVidvan","og_description":"With NumPy and Matplotlib, you have the power to perform complex numerical computations and create informative and visually appealing plots.","og_url":"https:\/\/techvidvan.com\/tutorials\/numpy-matpotlib\/","og_site_name":"TechVidvan","article_publisher":"https:\/\/www.facebook.com\/TechVidvan\/","article_published_time":"2024-06-24T12:30:30+00:00","article_modified_time":"2024-06-24T12:46:35+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/06\/numPy-matplotlib.webp","type":"image\/webp"}],"author":"TechVidvan Team","twitter_card":"summary_large_image","twitter_creator":"@vidvantech","twitter_site":"@vidvantech","twitter_misc":{"Written by":"TechVidvan Team","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/techvidvan.com\/tutorials\/numpy-matpotlib\/#article","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/numpy-matpotlib\/"},"author":{"name":"TechVidvan Team","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/dde481bb412350cde1ed6e389bc0deaf"},"headline":"NumPy Matpotlib &#8211; Data Visualization Plot","datePublished":"2024-06-24T12:30:30+00:00","dateModified":"2024-06-24T12:46:35+00:00","mainEntityOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/numpy-matpotlib\/"},"wordCount":730,"commentCount":0,"publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/numpy-matpotlib\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/06\/numPy-matplotlib.webp","keywords":["learn numpy","matplotlib and numpy","matpotlib","numpy","numpy and matpotlib","numpy matplotlib for data visualization","numpy matpotlib","numPy tutorial","numpy tutorial for beginners"],"articleSection":["NumPy Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/techvidvan.com\/tutorials\/numpy-matpotlib\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/techvidvan.com\/tutorials\/numpy-matpotlib\/","url":"https:\/\/techvidvan.com\/tutorials\/numpy-matpotlib\/","name":"NumPy Matpotlib - Data Visualization Plot - TechVidvan","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/#website"},"primaryImageOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/numpy-matpotlib\/#primaryimage"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/numpy-matpotlib\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/06\/numPy-matplotlib.webp","datePublished":"2024-06-24T12:30:30+00:00","dateModified":"2024-06-24T12:46:35+00:00","description":"With NumPy and Matplotlib, you have the power to perform complex numerical computations and create informative and visually appealing plots.","breadcrumb":{"@id":"https:\/\/techvidvan.com\/tutorials\/numpy-matpotlib\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/techvidvan.com\/tutorials\/numpy-matpotlib\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/numpy-matpotlib\/#primaryimage","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/06\/numPy-matplotlib.webp","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/06\/numPy-matplotlib.webp","width":1200,"height":628,"caption":"numPy matplotlib"},{"@type":"BreadcrumbList","@id":"https:\/\/techvidvan.com\/tutorials\/numpy-matpotlib\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/techvidvan.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"NumPy Matpotlib &#8211; Data Visualization Plot"}]},{"@type":"WebSite","@id":"https:\/\/techvidvan.com\/tutorials\/#website","url":"https:\/\/techvidvan.com\/tutorials\/","name":"TechVidvan Blogs","description":"","publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/techvidvan.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/techvidvan.com\/tutorials\/#organization","name":"TechVidvan","url":"https:\/\/techvidvan.com\/tutorials\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/logo\/image\/","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/03\/techvidvan-logo-200x50-1.webp","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/03\/techvidvan-logo-200x50-1.webp","width":200,"height":50,"caption":"TechVidvan"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/TechVidvan\/","https:\/\/x.com\/vidvantech"]},{"@type":"Person","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/dde481bb412350cde1ed6e389bc0deaf","name":"TechVidvan Team"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/447190","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/comments?post=447190"}],"version-history":[{"count":8,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/447190\/revisions"}],"predecessor-version":[{"id":447526,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/447190\/revisions\/447526"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media\/447525"}],"wp:attachment":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media?parent=447190"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/categories?post=447190"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/tags?post=447190"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}