{"id":54,"date":"2018-12-24T09:45:42","date_gmt":"2018-12-24T09:45:42","guid":{"rendered":"http:\/\/gantovnik.com\/bio-tips\/?p=54"},"modified":"2018-12-24T11:12:33","modified_gmt":"2018-12-24T11:12:33","slug":"contour-plot","status":"publish","type":"post","link":"https:\/\/gantovnik.com\/bio-tips\/2018\/12\/contour-plot\/","title":{"rendered":"Contour plot"},"content":{"rendered":"<pre>import os\nimport matplotlib.pyplot as plt\nimport numpy as np\nos.chdir('\/home\/vg\/Downloads\/projects\/ex6')\nos.getcwd()\nx = np.arange(-5,5,0.1)\ny = np.arange(-5,5,0.1)\nu,v = np.meshgrid(x,y)\nz = 2*u**2 + v**2 - u*v + 10*u\nplt.contour(x,y,z,50)\nplt.title('A contour map')\nplt.savefig(\"example6.png\", dpi=150)\nplt.show()\nplt.close()\n\n<img data-recalc-dims=\"1\" decoding=\"async\" class=\" size-full wp-image-56 aligncenter\" src=\"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2018\/12\/example6-1.png?resize=600%2C400\" alt=\"example6\" width=\"600\" height=\"400\" srcset=\"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2018\/12\/example6-1.png?w=600&amp;ssl=1 600w, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2018\/12\/example6-1.png?resize=300%2C200&amp;ssl=1 300w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>import os import matplotlib.pyplot as plt import numpy as np os.chdir(&#8216;\/home\/vg\/Downloads\/projects\/ex6&#8217;) os.getcwd() x = np.arange(-5,5,0.1) y = np.arange(-5,5,0.1) u,v = np.meshgrid(x,y) z = 2*u**2 + v**2 &#8211; u*v + 10*u plt.contour(x,y,z,50) plt.title(&#8216;A contour map&#8217;) plt.savefig(&#8220;example6.png&#8221;, dpi=150) plt.show() plt.close()<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","_lmt_disableupdate":"yes","_lmt_disable":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[2],"tags":[],"class_list":["post-54","post","type-post","status-publish","format-standard","hentry","category-python"],"modified_by":null,"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8bH0k-S","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":1980,"url":"https:\/\/gantovnik.com\/bio-tips\/2023\/12\/397-spiral-that-goes-around-circular-paraboloid-by-python\/","url_meta":{"origin":54,"position":0},"title":"#397 Spiral that goes around circular paraboloid by python","author":"gantovnik","date":"2023-12-18","format":false,"excerpt":"","rel":"","context":"In &quot;matplotlib&quot;","block_context":{"text":"matplotlib","link":"https:\/\/gantovnik.com\/bio-tips\/category\/matplotlib\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2023\/12\/ex397.png?fit=640%2C480&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2023\/12\/ex397.png?fit=640%2C480&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2023\/12\/ex397.png?fit=640%2C480&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":304,"url":"https:\/\/gantovnik.com\/bio-tips\/2019\/01\/training-a-perceptron-via-scikit-learn\/","url_meta":{"origin":54,"position":1},"title":"#53 Training a perceptron via scikit-learn","author":"gantovnik","date":"2019-01-22","format":false,"excerpt":"","rel":"","context":"In &quot;python&quot;","block_context":{"text":"python","link":"https:\/\/gantovnik.com\/bio-tips\/category\/python\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2019\/01\/example53.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2019\/01\/example53.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2019\/01\/example53.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":894,"url":"https:\/\/gantovnik.com\/bio-tips\/2021\/02\/160-max-and-min-using-argmax-and-argmax-in-python\/","url_meta":{"origin":54,"position":2},"title":"#160 Max and min using argmax and argmax in python","author":"gantovnik","date":"2021-02-14","format":false,"excerpt":"#160 Max and min using argmax and argmax in python","rel":"","context":"In &quot;python&quot;","block_context":{"text":"python","link":"https:\/\/gantovnik.com\/bio-tips\/category\/python\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2021\/02\/example160.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2021\/02\/example160.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2021\/02\/example160.png?resize=525%2C300 1.5x"},"classes":[]},{"id":1774,"url":"https:\/\/gantovnik.com\/bio-tips\/2023\/01\/338-minimization-using-newtons-method-on-the-non-quadratic-problem-in-python\/","url_meta":{"origin":54,"position":3},"title":"#338 Minimization using Newton\u2019s method on the non-quadratic problem in python","author":"gantovnik","date":"2023-01-16","format":false,"excerpt":"ex338.py","rel":"","context":"In &quot;optimization&quot;","block_context":{"text":"optimization","link":"https:\/\/gantovnik.com\/bio-tips\/category\/optimization\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2023\/01\/ex338.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2023\/01\/ex338.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2023\/01\/ex338.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2023\/01\/ex338.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2023\/01\/ex338.png?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2023\/01\/ex338.png?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":1770,"url":"https:\/\/gantovnik.com\/bio-tips\/2023\/01\/337-minimization-on-an-2d-quadratic-problem-using-the-gradient-descent-method-in-python\/","url_meta":{"origin":54,"position":4},"title":"#337 Minimization on an 2D quadratic problem using the gradient descent method in python","author":"gantovnik","date":"2023-01-15","format":false,"excerpt":"ex337.py","rel":"","context":"In &quot;optimization&quot;","block_context":{"text":"optimization","link":"https:\/\/gantovnik.com\/bio-tips\/category\/optimization\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2023\/01\/ex337.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2023\/01\/ex337.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2023\/01\/ex337.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":283,"url":"https:\/\/gantovnik.com\/bio-tips\/2019\/01\/perceptron-model\/","url_meta":{"origin":54,"position":5},"title":"Perceptron model","author":"gantovnik","date":"2019-01-21","format":false,"excerpt":"","rel":"","context":"In &quot;machine learning&quot;","block_context":{"text":"machine learning","link":"https:\/\/gantovnik.com\/bio-tips\/category\/machine-learning\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2019\/01\/example52.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2019\/01\/example52.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2019\/01\/example52.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/posts\/54","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/comments?post=54"}],"version-history":[{"count":0,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/posts\/54\/revisions"}],"wp:attachment":[{"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/media?parent=54"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/categories?post=54"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/tags?post=54"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}