0

Please help me figure out what the equation for this line is:

import matplotlib.pyplot as plt
import numpy as np

#start, stop, num (* is args [positional], ** is kwargs[keyword])
x = np.linspace(0, 2*np.pi, 400)
y = np.sin(x ** 2)

#this closes *args
plt.close('all')

#one figure and one subplot
f, ax = plt.subplots()
ax.plot(x,y)
ax.set_title("simple plot")
plt.xlabel('x-axis')
plt.ylabel('y-axis')
plt.show()

The code runs, and sends back a graph, but I cannot figure out what the equation of the graph is. Please help me, and if you can explain what the code did to graph that equation. I am very new to python. :) thank you!

Ava
  • 27
  • 2

1 Answers1

0

x**2 means x to the power 2 in Python. In other programming language it is mostly noted as x^2. So your function is y = sin(x*x)

onno
  • 969
  • 5
  • 9