1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # # µû¶óÇÏ¸ç ¹è¿ì´Â ÆÄÀ̽ã°ú µ¥ÀÌÅÍ°úÇÐ(»ý´ÉÃâÆÇ»ç 2020) # 11.6 ÇϳªÀÇ Â÷Æ®¿¡ ¿©·¯ °³ÀÇ µ¥ÀÌÅ͸¦ ±×·Áº¸ÀÚ, 288ÂÊ # import matplotlib.pyplot as plt x = [x / 10 for x in range(20)] # 0¿¡¼ 20±îÁöÀÇ Á¤¼ö¸¦ »ý¼º y = [(x / 10)**2 for x in range(20)] # 0¿¡¼ 20±îÁöÀÇ Á¤¼ö x¿¡ ´ëÇØ x Á¦°ö°ªÀ» »ý¼º z = [(x / 10)**3 for x in range(20)] # 0¿¡¼ 20±îÁöÀÇ Á¤¼ö x¿¡ ´ëÇØ x ¼¼Á¦°ö°ªÀ» »ý¼º i = [2**(x / 10) for x in range(20)] # 0¿¡¼ 20±îÁöÀÇ Á¤¼ö x¿¡ ´ëÇØ 2ÀÇ xÁ¦°ö°ªÀ» »ý¼º plt.plot(x, x, label='linear') # °¢ ¼±¿¡ ´ëÇÑ ·¹À̺í plt.plot(x, y, label='quadratic') plt.plot(x, z, label='qubic') plt.plot(x, i, label='power') plt.xlabel('x label') # x ÃàÀÇ ·¹À̺í plt.ylabel('y label') # y ÃàÀÇ ·¹À̺í plt.title("My Plot") plt.legend() # µðÆúÆ® À§Ä¡¿¡ ¹ü·Ê¸¦ Ç¥½ÃÇÑ´Ù plt.show() | cs |