Untitled
unknown
plain_text
a month ago
640 B
4
Indexable
import matplotlib.pyplot as plt import numpy as np # Creating a simple zigzag pattern x = np.linspace(0, 10, 100) y_zigzag = np.sin(x) * np.cos(x) # Creating a simple flat pattern y_flat = np.ones_like(x) * 0.5 # Creating the plot fig, ax = plt.subplots(figsize=(10, 6)) # Plotting the Zigzag pattern ax.plot(x, y_zigzag, label='Zigzag Pattern', color='b') # Plotting the Flat pattern ax.plot(x, y_flat, label='Flat Pattern', color='r', linestyle='--') # Adding labels and title ax.set_title('Example of Zigzag and Flat Patterns') ax.set_xlabel('Time') ax.set_ylabel('Price') ax.legend() # Showing the plot plt.grid(True) plt.show()
Editor is loading...
Leave a Comment