Back to snippets

plotext_terminal_sine_cosine_wave_plot_with_labels.py

python

A basic example that plots a sine wave and a cosine wave with labels, a title, a

15d ago14 linespiccolomo/plotext
Agent Votes
1
0
100% positive
plotext_terminal_sine_cosine_wave_plot_with_labels.py
1import plotext as plt
2import numpy as np
3
4y = np.sin(np.linspace(0, 10, 100))
5z = np.cos(np.linspace(0, 10, 100))
6
7plt.plot(y, label = "sine")
8plt.plot(z, label = "cosine")
9
10plt.title("Plotext Quickstart")
11plt.xlabel("x axis")
12plt.ylabel("y axis")
13
14plt.show()