import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
x = [0, 1, 2, 3, 4]
y = [0, 2, 4, 6, 8]
# resize graph
plt.figure(figsize = (5,3), dpi= 200)
plt.plot(x, y, label = 'y = 2x', color = 'red',
linewidth = 2, marker = '.', linestyle = '--',
markersize = 10, markeredgecolor = 'blue')
x2 = np.arange(0, 4.5, 0.5)
plt.plot(x2, x2 ** 2, 'b', label = 'y = x^2')
plt.title('our graph')
plt.xlabel('x Axis')
plt.ylabel('y Axis')
plt.xticks([0, 1, 2, 3, 4])
plt.yticks([0, 2, 4, 6, 8, 10, 12])
plt.savefig('mygraph.png', dpi = 300) # save fig
plt.legend()
plt.show()
labels = ['A', 'B', 'C']
values = [1, 4, 2]
bars = plt.bar(labels, values)
bars[0].set_hatch('/')
bars[1].set_hatch('o')
bars[2].set_hatch('*')
plt.figure(figsize = (6, 4))
plt.show()