Graph plotting using Matpiotlib in Python

Publicado em: 25 Fevereiro 2023
no canal de: Mr. Programmer
136
like

Graph plotting using Matpiotlib in Python,
logarithmic Functions,
trigonometric functions,
inverse trigonometric functions,
Algebraic functions,
exponential functions,
genral combination of LIATE function,
visualizing a Three dimensional function in Two dimensions,

#Like #share and #subscribe
#comment #yearofyou
Mr. Programmer
The program is given in the comment box below.

Note: Type this commands on CMD/terminal.

pip3 install numpy
pip3 install matplotlib


#___________________________________________


#Sourcecodes



#___________________________________________

#Visualising a Three Dimensinal Function in Two Dimensins.
function f(x)=sin^10(x)+cos(5+xy)sin(x) .

import numpy as np
import matplotlib.pyplot as plt
plt.style.use('seaborn-while')
def f(x,y):
return np.sin(x)**10+np.cos(5+y*x)*np.sin(x)
x= np.linspace(0,5,50)
y= np.linspace(0,5,50)
x,y=np.meshgrid(x,y)
z=f(x,y)
plt.contour(x,y,z,20,cmap='RdBu')
plt.colorbar()


#___________________________________________


#Trignometric Functin
#To plot the function f(x)=cos(x) on the interval [0,2pi].

import matplotlib.pyplot as pls
import numpy as np
x= np.arange(0,2*(np.pi),0.1)
y= np.cos(x)
pls.plot(x,y)
pls.show()


#___________________________________________

#Trignometric Functin
#To plot the function f(x)=cos(x) on the interval [0,2pi].

import matplotlib.pyplot as pls
import numpy as np
x= np.arange(0,2*(np.pi),0.1)
y= np.cos(x)
pls.plot(x,y)
pls.show()


#___________________________________________


#Logarithmic Functin
#To plot the function f(x)=log10(x) on the interval [0,10].

import matplotlib.pyplot as pls
import numpy as np
x= np.linspace(0,10)
y= np.log10(x)
pls.plot(x,y)
pls.show()


#___________________________________________

#Inverse Trignometric Functin
#To plot the function f(x)=sin^-1(x) on the interval [-1,1].

import matplotlib.pyplot as pls
import numpy as np
x= np.arange(-1,1,0.01)
y= np.arcsin(x)
pls.plot(x,y)
pls.show()


#___________________________________________

#General Combination of LIATE Functin
#To plot the function f(x)=sinx-e^x+3x^2-log10x on the interval [0,2pi].

import matplotlib.pyplot as plt
import numpy as np
x= np.arange(0,2*(np.pi),0.1)
y= np.sin(x)-np.exp(x)+3*x**2+np.log10(x)
plt.plot(x,y)
plt.show()


#___________________________________________

#ExponentialF Functin
#To plot the function f(x)=e^x on the interval [-1,100].

import numpy as np
import matplotlib.pyplot as pls
x= np.linspace(-1,2,100)
y= np.exp(x)
pls.plot(x,y)
pls.show()


#___________________________________________


#Algebraic Functin
#To plot the function f(x)=x^2 on the interval [-2,2].

import matplotlib.pyplot as pls
import numpy as np
x= np.linspace(-2,2,100)
y= x**2
fig=pls.figure(figsize=(10,5))
pls.plot(x,y)
pls.show()

#___________________________________________


#Like #share and #subscribe
Programmers write code for computer programs and mobile applications. They also are involved in maintaining, debugging and troubleshooting systems and software to ensure that everything is running smoothly.

Mr. Programmer writes code in all programming languages. If you have any questions about any programming language, you can write questions in the comment box. Of course you do The program or video of that program will be provided.

#MrProgrammer

Graph plotting using #Matpiotlib in #Python,
#logarithmic #Functions,
#trigonometric functions,
#inverse trigonometric functions,
#Algebraic functions,
#exponential functions,
#genral #combination of #LIATE function,
#visualizing a Three #dimensional function in Two dimensions,


Nesta página do site você pode assistir ao vídeo on-line Graph plotting using Matpiotlib in Python duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Mr. Programmer 25 Fevereiro 2023, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 136 vezes e gostou like espectadores. Boa visualização!