Normal Distribution Plot using Numpy and Matplotlib Last Updated : 30 Jul, 2024 Comments Improve Suggest changes Like Article Like Report In this article, we will see how we can create a normal distribution plot in python with numpy and matplotlib module. What is Normal Distribution?Normal Distribution is a probability function used in statistics that tells about how the data values are distributed. It is the most important probability distribution function used in statistics because of its advantages in real case scenarios. For example, the height of the population, shoe size, IQ level, rolling a die, and many more.It is generally observed that data distribution is normal when there is a random collection of data from independent sources. The graph produced after plotting the value of the variable on x-axis and count of the value on y-axis is bell-shaped curve graph. The graph signifies that the peak point is the mean of the data set and half of the values of data set lie on the left side of the mean and other half lies on the right part of the mean telling about the distribution of the values. The graph is symmetric distribution. Modules NeededNumpy is a general-purpose array-processing package. It provides a high-performance multidimensional array object, and tools for working with these arrays. It is the fundamental package for scientific computing with Python.Besides its obvious scientific uses, Numpy can also be used as an efficient multi-dimensional container of generic data.Matplotlib is a plotting library for creating static, animated, and interactive visualizations in Python. Matplotlib can be used in Python scripts, the Python and IPython shell, web application servers, and various graphical user interface toolkits like Tkinter, awxPython, etc.Below are some program which create a Normal Distribution plot using Numpy and Matplotlib module:Example 1: Python3 # importing numpy as np import numpy as np # importing pyplot as plt import matplotlib.pyplot as plt # position pos = 100 # scale scale = 5 # size size = 100000 # creating a normal distribution data values = np.random.normal(pos, scale, size) # plotting histograph plt.hist(values, 100) # showing the graph plt.show() Output : Example 2: Python3 # importing numpy as np import numpy as np # importing pyplot as plt import matplotlib.pyplot as plt # position pos = 0 # scale scale = 10 # size size = 10000 # random seed np.random.seed(10) # creating a normal distribution data values = np.random.normal(pos, scale, size) # plotting histograph plt.hist(values, 100) # plotting mean line plt.axvline(values.mean(), color='k', linestyle='dashed', linewidth=2) # showing the plot plt.show() Output : Comment More infoAdvertise with us Next Article Normal Distribution Plot using Numpy and Matplotlib R rakshitarora Follow Improve Article Tags : Python Python-numpy Python-matplotlib Practice Tags : python Similar Reads How to plot a normal distribution with Matplotlib in Python? Normal distribution, also known as the Gaussian distribution, is a fundamental concept in probability theory and statistics. It is a symmetric, bell-shaped curve that describes how data values are distributed around the mean. The probability density function (PDF) of a normal distribution is given b 4 min read Normal Distribution in NumPy The Normal Distribution also known as the Gaussian Distribution is one of the most important distributions in statistics and data science. It is widely used to model real-world phenomena such as IQ scores, heart rates, test results and many other naturally occurring events.numpy.random.normal() Meth 2 min read Save Plot To Numpy Array using Matplotlib Saving a plot to a NumPy array in Python is a technique that bridges data visualization with array manipulation allowing for the direct storage of graphical plots as array representations, facilitating further computational analyses or modifications within a Python environment. Let's learn how to Sa 4 min read Generate five random numbers from the normal distribution using NumPy In Numpy we are provided with the module called random module that allows us to work with random numbers. The random module provides different methods for data distribution. In this article, we have to create an array of specified shape and fill it random numbers or values such that these values are 2 min read Python - Normal Distribution in Statistics A probability distribution determines the probability of all the outcomes a random variable takes. The distribution can either be continuous or discrete distribution depending upon the values that a random variable takes. There are several types of probability distribution like Normal distribution, 6 min read Introduction to 3D Plotting with Matplotlib In this article, we will be learning about 3D plotting with Matplotlib. There are various ways through which we can create a 3D plot using matplotlib such as creating an empty canvas and adding axes to it where you define the projection as a 3D projection, Matplotlib.pyplot.gca(), etc. Creating an E 15+ min read Python - Log Normal Distribution in Statistics scipy.stats.lognorm() is a log-Normal continuous random variable. It is inherited from the of generic methods as an instance of the rv_continuous class. It completes the methods with details specific for this particular distribution. Parameters : q : lower and upper tail probability x : quantiles lo 2 min read Matplotlib.colors.Normalize class in Python Matplotlib is an amazing visualization library in Python for 2D plots of arrays. Matplotlib is a multi-platform data visualization library built on NumPy arrays and designed to work with the broader SciPy stack.  matplotlib.colors.Normalize The matplotlib.colors.Normalize class belongs to the matpl 3 min read Contour Plot using Matplotlib - Python Contour plots also called level plots are a tool for doing multivariate analysis and visualizing 3-D plots in 2-D space. If we consider X and Y as our variables we want to plot then the response Z will be plotted as slices on the X-Y plane due to which contours are sometimes referred as Z-slices or 2 min read Python - Power Normal Distribution in Statistics scipy.stats.powernorm() is a power normal continuous random variable. It is inherited from the of generic methods as an instance of the rv_continuous class. It completes the methods with details specific for this particular distribution. Parameters : q : lower and upper tail probability x : quantile 2 min read Like