Python Library/Pandas
Day 7. Drawing Graphs With Pandas
hellobird
2019. 7. 2. 12:56
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | import matplotlib.pyplot as plt from matplotlib.lines import Line2D x = [ x for x in range(-12, 12) ] y = [ 2 * x - 1 for x in range(-12, 12) ] y2 = [ -1* x + 2 for x in range(-12, 12) ] fig = plt.figure() ax = fig.add_subplot(111) line = Line2D(x, y) ax.add_line(line) ax.set_xlim(min(x), max(x)) ax.set_ylim(min(y), max(y)) ax.grid() plt.show() | cs |