{"id":10192,"date":"2020-08-10T10:59:21","date_gmt":"2020-08-10T01:59:21","guid":{"rendered":"http:\/\/www.gisdeveloper.co.kr\/?p=10192"},"modified":"2020-08-11T21:38:34","modified_gmt":"2020-08-11T12:38:34","slug":"matplotlib%ec%9d%98-%eb%93%b1%ec%b9%98%ec%84%a0contour-%ed%91%9c%ed%98%84%ed%95%98%ea%b8%b0","status":"publish","type":"post","link":"http:\/\/www.gisdeveloper.co.kr\/?p=10192","title":{"rendered":"matplotlib\uc758 \ub4f1\uce58\uc120(contour) \ud45c\ud604\ud558\uae30"},"content":{"rendered":"<p>\ub4f1\uce58\uc120\uc740 \uacf5\uac04\uc0c1\uc5d0 \ubd84\ud3ec\ud558\ub294 \ub3d9\uc77c\ud55c \uac12\uc744 \uac00\uc9c0\ub294 \uc778\uc811\ud55c \uc9c0\uc810\uc744 \uc5f0\uc18d\uc801\uc73c\ub85c \uc774\uc5b4 \uad6c\uc131\ud55c \uc120\uc785\ub2c8\ub2e4. \ub300\uae30 \ud655\uc0b0 \ubaa8\ub378\uc744 \uc2dc\uac01\ud654\ud558\uae30 \uc704\ud55c \ub9e4\uc6b0 \ud6a8\uacfc\uc801\uc778 \ubc29\ubc95\uc785\ub2c8\ub2e4.<\/p>\n<p>\uc544\ub798\uc758 \uadf8\ub9bc\uc740 contour \uadf8\ub798\ud504\ub97c \uad6c\uc131\ud558\uae30 \uc704\ud55c \ucf54\ub4dc\ub85c\uc368 \uc791\uc131\ud55c \uc608\uc81c\uc5d0 \ub300\ud55c \uacb0\uacfc\uc785\ub2c8\ub2e4.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.gisdeveloper.co.kr\/wp-content\/uploads\/2020\/08\/matplot_contour.png\" alt=\"\" width=\"1736\" height=\"1298\" class=\"aligncenter size-full wp-image-10193\" \/><\/p>\n<p>\uc704\uc758 \uacb0\uacfc\ub97c \uc704\ud574\uc11c\ub294 \uba3c\uc800 \uc2dc\uac01\ud654 \ub300\uc0c1\uc774 \ub418\ub294 \ub370\uc774\ud130\uac00 \ud544\uc694\ud569\ub2c8\ub2e4. \uacf5\uac04\uc0c1\uc5d0 \uade0\uc77c\ud558\uac8c \ubd84\ud3ec\ud558\ub294 \uac12\uc5d0 \ub300\ud55c \ub370\uc774\ud130\uc778\ub370\uc694. \ub370\uc774\ud130 \uad6c\uc131\uc744 \uc704\ud55c \ucf54\ub4dc\ub294 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\">\r\nimport matplotlib.pyplot as plt\r\nimport matplotlib.tri as tri\r\nimport numpy as np\r\n\r\nnpts = 100\r\nx = np.random.uniform(-2, 2, npts)\r\ny = np.random.uniform(-2, 2, npts)\r\nz = x * np.exp(-x**2 - y**2)\r\n\r\nngridx = 100\r\nngridy = 100\r\nxi = np.linspace(-2.2, 2.2, ngridx)\r\nyi = np.linspace(-2.2, 2.2, ngridy)\r\n\r\ntriang = tri.Triangulation(x, y)\r\ninterpolator = tri.LinearTriInterpolator(triang, z)\r\nXi, Yi = np.meshgrid(xi, yi)\r\nzi = interpolator(Xi, Yi)\r\n<\/pre>\n<p>\uc704\uc758 \ucf54\ub4dc\ub97c \ud1b5\ud574 2\ucc28\uc6d0(x, y) \uacf5\uac04 \uc0c1\uc5d0 \ubd84\ud3ec\ud558\ub294 \uac12(z)\uc73c\ub85c \ubcc0\uc218 xi, yi, zi\ub97c \uc5bb\uac8c \ub429\ub2c8\ub2e4. \uc774 3\uac1c\uc758 \ubcc0\uc218\ub97c \uc774\uc6a9\ud574 \ub4f1\uce58\uc120\uc744 \ud45c\ud604\ud560 \uc218 \uc788\ub294\ub370, \uadf8 \ucf54\ub4dc\ub294 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\">\r\nplt.contour(xi, yi, zi, levels=15, linewidths=0.5, colors='k')\r\n\r\ncntr = plt.contourf(xi, yi, zi, levels=15, cmap=\"RdBu_r\")\r\nplt.colorbar(cntr)\r\nplt.plot(x, y, 'ko', ms=3)\r\n\r\nplt.show()\r\n<\/pre>\n<p>\uc704\uc758 \ucf54\ub4dc \uc911 1\ubc88\uc774 \uc9c0\uc815\ud55c levels \uc218\uc5d0 \ub9de\uac8c \ub4f1\uce58\uc120(\uac80\uc815\uc0c9 \uc120)\uc744 \ud45c\ud604\ud558\uba70, 3\ubc88 \ucf54\ub4dc\ub294 \ub4f1\uce58\uac12\ub4e4\uc744 \ud3ec\ud568\ud558\ub294 \uc601\uc5ed\uc744 \uc9c0\uc815\ud55c levels \uc218\uc5d0 \ub9de\uac8c \ud45c\ud604\ud558\ub294 \ucf54\ub4dc\uc785\ub2c8\ub2e4.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\ub4f1\uce58\uc120\uc740 \uacf5\uac04\uc0c1\uc5d0 \ubd84\ud3ec\ud558\ub294 \ub3d9\uc77c\ud55c \uac12\uc744 \uac00\uc9c0\ub294 \uc778\uc811\ud55c \uc9c0\uc810\uc744 \uc5f0\uc18d\uc801\uc73c\ub85c \uc774\uc5b4 \uad6c\uc131\ud55c \uc120\uc785\ub2c8\ub2e4. \ub300\uae30 \ud655\uc0b0 \ubaa8\ub378\uc744 \uc2dc\uac01\ud654\ud558\uae30 \uc704\ud55c \ub9e4\uc6b0 \ud6a8\uacfc\uc801\uc778 \ubc29\ubc95\uc785\ub2c8\ub2e4. \uc544\ub798\uc758 \uadf8\ub9bc\uc740 contour \uadf8\ub798\ud504\ub97c \uad6c\uc131\ud558\uae30 \uc704\ud55c \ucf54\ub4dc\ub85c\uc368 \uc791\uc131\ud55c \uc608\uc81c\uc5d0 \ub300\ud55c \uacb0\uacfc\uc785\ub2c8\ub2e4. \uc704\uc758 \uacb0\uacfc\ub97c \uc704\ud574\uc11c\ub294 \uba3c\uc800 \uc2dc\uac01\ud654 \ub300\uc0c1\uc774 \ub418\ub294 \ub370\uc774\ud130\uac00 \ud544\uc694\ud569\ub2c8\ub2e4. \uacf5\uac04\uc0c1\uc5d0 \uade0\uc77c\ud558\uac8c \ubd84\ud3ec\ud558\ub294 \uac12\uc5d0 \ub300\ud55c \ub370\uc774\ud130\uc778\ub370\uc694. \ub370\uc774\ud130 \uad6c\uc131\uc744 \uc704\ud55c \ucf54\ub4dc\ub294 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4. import matplotlib.pyplot as &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/www.gisdeveloper.co.kr\/?p=10192\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;matplotlib\uc758 \ub4f1\uce58\uc120(contour) \ud45c\ud604\ud558\uae30&#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":[1],"tags":[],"class_list":["post-10192","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/10192","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=10192"}],"version-history":[{"count":4,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/10192\/revisions"}],"predecessor-version":[{"id":10197,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/10192\/revisions\/10197"}],"wp:attachment":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10192"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10192"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10192"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}