%matplotlib inline
import matplotlib.pyplot as plt
x = [1, 2, 3]
y_1 = [50, 60, 70]
y_2 = [20, 30, 40]
plt.figure(figsize=(3,3))
plt.plot(x, y_1, marker='x')
plt.plot(x, y_2, marker='^')
plt.xlim([0, len(x)+1])
plt.ylim([0, max(y_1+y_2) + 10])
plt.xlabel('x-axis label')
plt.ylabel('y-axis label')
plt.title('Simple line plot')
plt.legend(['sample 1', 'sample2'], loc='upper left')
plt.savefig('ipy_inline.png', dpi=90, bbox_inches=None)
from IPython.display import Image, display
display(Image('agg.png'))
display(Image('ipy_inline.png'))