Learn Before
Code
Alternate Line Plot Method
Matplotlib also has a built in module that allows for visualization of line plots.
from matplotlib import pyplot as plt x=[1,2,3,4] y=[1,4,3,2] y_2=[5,4,1,6] axis=[0,1,2,3,4,5,6] zero=[0,0,0,0,0,0,0] plt.plot(x, y, color='m', linestyle='--', marker='.', label='Thing One') plt.plot(x, y_2, color='b', linewidth=3, label='Thing Two') plt.plot(axis, zero, linewidth=4, color='k') plt.plot(zero, axis, linewidth=4, color='k') plt.xlabel('Time') plt.ylabel('Number of things') plt.title('Basic Plot') plt.legend() plt.tight_layout() plt.grid(True) plt.savefig('plt.png') plt.show()

0
1
Updated 2021-07-16
Tags
Python Programming Language
Data Science