Learn Exponential function with Matplotlib

Codistwa

Learn Exponential function

with Matplotlib

Reading time : 1 min

Last update : February 11th, 2022

The exponential function with base e is the inverse of the neperian logarithm. It represents a function that grows rapidly. The x is the power of e. Let's use Matplotlib to represent it.

Half off everything 2manning

Display of the function

The exponential function is used to define the real power of a strictly positive number a.

Amusement Park I

The comic strip represents characters on a roller coaster. First, the start is slow, then as the speed increases with a rise, and finally, in the last plate of the comic strip, the ride is launched at high speed. Like an exponential function does.

Code

pythonpython
1x = np.linspace(-3,3,100)
2
3plt.plot(x,np.exp(x))
4plt.xlabel('x')
5plt.ylabel('$e^x$')
6
7plt.grid()
8
9plt.title('Exponential', fontsize=12)
10plt.savefig('exponential', bbox_inches='tight')
11
12plt.show()
Exponential function

Formula

Print booksmanning

The exponential function is a function that grows very fast and is always positive. It can be easily represented with Matplotlib.

Ressources

Source code