{"id":7353,"date":"2019-11-11T09:00:08","date_gmt":"2019-11-11T00:00:08","guid":{"rendered":"http:\/\/www.gisdeveloper.co.kr\/?p=7353"},"modified":"2020-05-28T09:57:57","modified_gmt":"2020-05-28T00:57:57","slug":"%ed%8c%8c%ec%9d%b4%ec%8d%ac%ec%9d%98-matplotlb-%eb%85%b8%ed%8a%b8","status":"publish","type":"post","link":"http:\/\/www.gisdeveloper.co.kr\/?p=7353","title":{"rendered":"\ud30c\uc774\uc36c\uc758 matplotlib \ub178\ud2b8"},"content":{"rendered":"<p>\ud30c\uc774\uc36c\uc758 matplotlib\ub294 \uc218\uce58 \ub370\uc774\ud130\ub97c \uadf8\ub798\ud504\ub85c \ud6a8\uacfc\uc801\uc73c\ub85c \ud45c\uc2dc\ud574\uc8fc\ub294 API\uc785\ub2c8\ub2e4. \uc774\uc5d0 \ub300\ud574 \uac04\ub2e8\ud55c \ud65c\uc6a9 \uc608\uc2dc\uc5d0 \ub300\ud55c \ucf54\ub4dc\ub97c \uae30\ub85d\ud574 \ub461\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\">\r\nimport matplotlib.pyplot as plt\r\n\r\nx = [1, 2, 3, 4, 5]\r\ny = [1, 2, 3, 4, 5]\r\n\r\nplt.scatter(x, y)\r\n\r\nplt.show()\r\n<\/pre>\n<p>X\ucd95\uacfc Y\ucd95\uc5d0 \ub300\ud55c \ud3ec\uc778\ud2b8 \ub370\uc774\ud130\ub97c \ud45c\uc2dc\ud558\ub294 \ucf54\ub4dc\uc785\ub2c8\ub2e4. \uacb0\uacfc\ub294 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.gisdeveloper.co.kr\/wp-content\/uploads\/2019\/06\/matplot_scatter.png\" alt=\"\" width=\"642\" height=\"546\" class=\"aligncenter size-full wp-image-7586\" \/><\/p>\n<p>\uadf8\ub798\ud504\uc5d0\uc11c \ud3ec\uc778\ud2b8\uc758 \ud06c\uae30\uc640 \uc0c9\uc0c1, \ud22c\uba85\ub3c4\ub97c \uc9c0\uc815\ud558\ub294 \uc608\uc81c\ub294 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\">\r\nimport matplotlib.pyplot as plt\r\n\r\nx = [1, 2, 3, 4, 5]\r\ny = [1, 2, 3, 4, 5]\r\ns = [10, 20, 30, 40, 50]\r\n\r\nplt.scatter(x = x, y = y, s = s, c = 'red', alpha=0.5)\r\n\r\nplt.show()\r\n<\/pre>\n<p>\uacb0\uacfc\ub294 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.gisdeveloper.co.kr\/wp-content\/uploads\/2019\/06\/matplot_scatter2.png\" alt=\"\" width=\"642\" height=\"546\" class=\"aligncenter size-full wp-image-7588\" \/><\/p>\n<p>\ub2e4\uc74c\uc740 \uaebd\uc740\uc120 \uadf8\ub798\ud504\uc785\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\">\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\n\r\nx = np.arange(0, 10, 0.5)\r\ny = np.sin(x)\r\n\r\nplt.plot(x, y)\r\nplt.show()\r\n<\/pre>\n<p>x\ucd95\uacfc y\ucd95\uc758 \ub370\uc774\ud130\ub294 4\ubc88\uacfc 5\ubc88 \ucf54\ub4dc\uc5d0\uc11c \uc815\uc758\ud569\ub2c8\ub2e4. \uacb0\uacfc\ub294 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.gisdeveloper.co.kr\/wp-content\/uploads\/2019\/06\/pyplot01.png\" alt=\"\" width=\"642\" height=\"546\" class=\"aligncenter size-full wp-image-7356\" \/><\/p>\n<p>\ud558\ub098\uc758 \ucc28\ud2b8\uc5d0 \uc5ec\ub7ec\uac1c\uc758 \uadf8\ub798\ud504\ub97c \ub3d9\uc2dc\uc5d0 \ud45c\uc2dc\ud558\uace0, \ucd94\uac00\uc801\uc73c\ub85c \uc81c\ubaa9, \ucd95\uc774\ub984 \ub4f1\uc744 \ud45c\uc2dc\ud558\ub294 \ucf54\ub4dc\uc785\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\">\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\n\r\nx = np.arange(0, 10, 0.5)\r\ny1 = np.sin(x)\r\ny2 = np.cos(x)\r\n\r\nplt.plot(x, y1, label=\"sin(x)\")\r\nplt.plot(x, y2, label=\"cos(x)\", linestyle=\"--\")\r\n\r\nplt.xlabel(\"x\")\r\nplt.xlabel(\"y\")\r\n\r\nplt.title(\"sin & cos\")\r\nplt.legend()\r\n\r\nplt.show()\r\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.gisdeveloper.co.kr\/wp-content\/uploads\/2019\/06\/pyplot02.png\" alt=\"\" width=\"642\" height=\"546\" class=\"aligncenter size-full wp-image-7358\" \/><\/p>\n<p>3\ucc28\uc6d0 \ucc28\ud2b8\uc758 \uacbd\uc6b0 \uba3c\uc800 X, Y\ucd95\uc5d0 \ub300\ud55c \ub370\uc774\ud130\uc640 \uc774 X, Y\ub97c \ubcc0\uc218\ub85c \ud558\uc5ec \uacc4\uc0b0\ub41c Z \uac12\uc758 \ud568\uc218\uac00 \uc815\uc758\ud574\uc57c \ud569\ub2c8\ub2e4. \uc774\ub807\uac8c \uc815\uc758\ub41c X, Y, Z\uc5d0 \ub300\ud55c 3\ucc28\uc6d0 \uadf8\ub798\ud504\ub294 \uc544\ub798\uc758 \uc608\uc81c \ucf54\ub4dc\ub97c \ud1b5\ud574 3\ucc28\uc6d0 \ucc28\ud2b8\ub85c \uc2dc\uac01\ud654\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\">\r\nimport numpy as np\r\nfrom mpl_toolkits.mplot3d import Axes3D\r\nimport matplotlib.pyplot as plt\r\n\r\nX = np.arange(-5, 5, 0.25)\r\nY = np.arange(-5, 5, 0.25)\r\nX, Y = np.meshgrid(X, Y)\r\nZ = X**2 + Y**2\r\n\r\nfig = plt.figure()\r\nax = fig.gca(projection='3d')\r\nsurf = ax.plot_wireframe(X, Y, Z, color='black')\r\n\r\nplt.show()\r\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.gisdeveloper.co.kr\/wp-content\/uploads\/2019\/06\/plot3d_python.png\" alt=\"\" width=\"936\" height=\"772\" class=\"aligncenter size-full wp-image-7388\" \/><\/p>\n<p>\uc5ec\ub7ec\uac1c\uc758 \ucc28\ud2b8\ub97c \ub3d9\uc2dc\uc5d0 \ud45c\uc2dc\ud558\ub294 \uacbd\uc6b0\uc785\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\">\r\nimport matplotlib.pyplot as plt\r\nimport numpy as np\r\n\r\nx = np.linspace(0, np.pi * 3, 100)\r\nfig, axes = plt.subplots(2,2)\r\n\r\naxes[0][0].plot(x, np.sin(x))\r\naxes[0][1].plot(x, np.arccos(x))\r\naxes[1][0].plot(x, np.cos(x))\r\naxes[1][1].plot(x, np.arcsin(x))\r\n\r\nplt.show()\r\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.gisdeveloper.co.kr\/wp-content\/uploads\/2019\/06\/multi_chats.png\" alt=\"\" width=\"1095\" height=\"914\" class=\"aligncenter size-full wp-image-8490\" \/><\/p>\n<p>\uc544\ub798\ub294 \ucc28\ud2b8\ub97c \uadf8\ub9ac\ub294 \uc2a4\ud0c0\uc77c\uc744 \uc9c0\uc815\ud558\uace0 \ubc94\ub840\ub97c \ud45c\ud604\ud558\ub294 \ucf54\ub4dc\uc785\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\">\r\nimport matplotlib.pyplot as plt\r\nimport numpy as np\r\n\r\nx = np.arange(-10,10)\r\ny = x**2\r\n\r\nplt.plot(x, y, \r\n    linewidth=2, color='green', linestyle=':', \r\n    marker='*', markersize=10, markerfacecolor='yellow', markeredgecolor='red', \r\n    label='y=x^2')\r\n   \r\nplt.legend()\r\n\r\nplt.show()\r\n<\/pre>\n<p>\uacb0\uacfc\ub294 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.gisdeveloper.co.kr\/wp-content\/uploads\/2019\/11\/chart_style.png\" alt=\"\" width=\"1032\" height=\"874\" class=\"aligncenter size-full wp-image-8492\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\ud30c\uc774\uc36c\uc758 matplotlib\ub294 \uc218\uce58 \ub370\uc774\ud130\ub97c \uadf8\ub798\ud504\ub85c \ud6a8\uacfc\uc801\uc73c\ub85c \ud45c\uc2dc\ud574\uc8fc\ub294 API\uc785\ub2c8\ub2e4. \uc774\uc5d0 \ub300\ud574 \uac04\ub2e8\ud55c \ud65c\uc6a9 \uc608\uc2dc\uc5d0 \ub300\ud55c \ucf54\ub4dc\ub97c \uae30\ub85d\ud574 \ub461\ub2c8\ub2e4. import matplotlib.pyplot as plt x = [1, 2, 3, 4, 5] y = [1, 2, 3, 4, 5] plt.scatter(x, y) plt.show() X\ucd95\uacfc Y\ucd95\uc5d0 \ub300\ud55c \ud3ec\uc778\ud2b8 \ub370\uc774\ud130\ub97c \ud45c\uc2dc\ud558\ub294 \ucf54\ub4dc\uc785\ub2c8\ub2e4. \uacb0\uacfc\ub294 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4. \uadf8\ub798\ud504\uc5d0\uc11c \ud3ec\uc778\ud2b8\uc758 \ud06c\uae30\uc640 \uc0c9\uc0c1, \ud22c\uba85\ub3c4\ub97c \uc9c0\uc815\ud558\ub294 \uc608\uc81c\ub294 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/www.gisdeveloper.co.kr\/?p=7353\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;\ud30c\uc774\uc36c\uc758 matplotlib \ub178\ud2b8&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[131,1],"tags":[],"class_list":["post-7353","post","type-post","status-publish","format-standard","hentry","category-python","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/7353","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7353"}],"version-history":[{"count":12,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/7353\/revisions"}],"predecessor-version":[{"id":9353,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/7353\/revisions\/9353"}],"wp:attachment":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7353"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7353"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7353"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}