hi im new to code and trying to plot an asymptote at y=x in python where my y and x are both functions ''' """ Created on Sun Oct 31 10:57:16 2021
@author: mackenzie """ import NumPy as np #define t
t=np.linspace(0.1,10,1000)
#define x
x=(4/3)t (np.cos(13t))/t
#define y
y=(4/3)t (np.sin(13t))/t
#imprort mat plot
import matplotlib.pyplot as plt
#plot the graphs plt.plot(x,y,'g--')
#make the graph look nice plt.title('x(t) versus y(t)')
plt.xlabel('x(t)')
plt.ylabel('y(t)') '''
how would I plot an asymptote for this curve where y=x
CodePudding user response:
If you're wanting to plot a y=x
line then this will do
plt.plot(x,x)
CodePudding user response:
Maybe you missed plt.show()
import numpy as np
t=np.linspace(0.1,10,1000)
#define x
x=(4/3)*t (np.cos(13*t))/t
#define y
y=(4/3)*t (np.sin(13*t))/t
#imprort mat plot
import matplotlib.pyplot as plt
#plot the graphs
plt.plot(x,x,'g--')
#make the graph look nice
plt.title('x(t) versus y(t)')
plt.xlabel('x(t)')
plt.ylabel('y(t)')
plt.show()