In [2]:
import numpy as np
import matplotlib.pyplot as plt
# Define the function you want to plot
def f(x):
return np.sin(x) # You can change this to any function, e.g., x**2, np.exp(x), etc.
# Generate x values (domain)
x = np.linspace(-10, 10, 500) # From -10 to 10 with 500 points
# Compute y values
y = f(x)
# Create the plot
plt.figure(figsize=(8, 5))
plt.plot(x, y, label='f(x) = sin(x)', color='blue')
plt.title('Plot of f(x)')
plt.xlabel('x')
plt.ylabel('f(x)')
plt.grid(True)
plt.legend()
plt.axhline(0, color='black', linewidth=0.5) # x-axis
plt.axvline(0, color='black', linewidth=0.5) # y-axis
# Show the plot
plt.show()
The history saving thread hit an unexpected error (OperationalError('attempt to write a readonly database')).History will not be written to the database.
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]: