{"id":316,"date":"2023-08-04T06:15:04","date_gmt":"2023-08-04T12:15:04","guid":{"rendered":"https:\/\/kop.lat\/blog\/?p=316"},"modified":"2023-08-04T06:15:04","modified_gmt":"2023-08-04T12:15:04","slug":"python-plot-using-numpy-and-matplotlib","status":"publish","type":"post","link":"https:\/\/kop.lat\/blog\/python-plot-using-numpy-and-matplotlib\/","title":{"rendered":"python plot &#8211; using numpy and matplotlib"},"content":{"rendered":"\n<p>Using numpy and matplotlib, a sequence of sinusoids can be created, like a piece of art.<\/p>\n\n\n\n<p>In this case, a nested iteration allows to overlay each plot over each other with an offset value that comes from the looping control variables. <\/p>\n\n\n\n<p>Below the code and the result<\/p>\n\n\n\n<div class=\"dm-code-snippet dark dm-normal-version default no-background-mobile\" snippet-height=\"\" style=\"background-color:#7FC8A9\"><div class=\"control-language\"><div class=\"dm-buttons\"><div class=\"dm-buttons-left\"><div class=\"dm-button-snippet red-button\"><\/div><div class=\"dm-button-snippet orange-button\"><\/div><div class=\"dm-button-snippet green-button\"><\/div><\/div><div class=\"dm-buttons-right\"><a id=\"dm-copy-raw-code\"><span class=\"dm-copy-text\">Copy Code<\/span><span class=\"dm-copy-confirmed\" style=\"display:none\">Copied<\/span><span class=\"dm-error-message\" style=\"display:none\">Use a different Browser<\/span><\/a><\/div><\/div><pre class=\" line-numbers\"><code id=\"dm-code-raw\" class=\" no-wrap language-python\">from numpy import *\nfrom matplotlib import *\nfrom matplotlib.pyplot import *\n\nt = arange(0.0, 1.0, 0.01)\n\nfig = figure(1)\n\nfig1 = fig.add_subplot(111)\n#fig1.plot(t, sin(2*pi*t))\n#fig1.grid(True)\n\nfor i in range(1,20):\n\tfor j in range(1,30):\n\t\tfig1.plot(t, j*sin(2*pi*t\/0.5+(i)), linewidth=0.2, color='black')\n\nshow()<\/code><\/pre><\/div><\/div>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"1024\" height=\"626\" src=\"https:\/\/kop.lat\/blog\/wp-content\/uploads\/2023\/08\/Figure_1-1024x626.png\" alt=\"\" class=\"wp-image-317\" srcset=\"https:\/\/kop.lat\/blog\/wp-content\/uploads\/2023\/08\/Figure_1-1024x626.png 1024w, https:\/\/kop.lat\/blog\/wp-content\/uploads\/2023\/08\/Figure_1-300x183.png 300w, https:\/\/kop.lat\/blog\/wp-content\/uploads\/2023\/08\/Figure_1-768x469.png 768w, https:\/\/kop.lat\/blog\/wp-content\/uploads\/2023\/08\/Figure_1-1536x939.png 1536w, https:\/\/kop.lat\/blog\/wp-content\/uploads\/2023\/08\/Figure_1.png 1857w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Using numpy and matplotlib, a sequence of sinusoids can be created, like a piece of art. In this case, a nested iteration allows to overlay each plot over each other with an offset value that comes from the looping control variables. Below the code and the result<\/p>\n","protected":false},"author":1,"featured_media":278,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[32,31],"tags":[23,33,34],"_links":{"self":[{"href":"https:\/\/kop.lat\/blog\/wp-json\/wp\/v2\/posts\/316"}],"collection":[{"href":"https:\/\/kop.lat\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kop.lat\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kop.lat\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kop.lat\/blog\/wp-json\/wp\/v2\/comments?post=316"}],"version-history":[{"count":1,"href":"https:\/\/kop.lat\/blog\/wp-json\/wp\/v2\/posts\/316\/revisions"}],"predecessor-version":[{"id":318,"href":"https:\/\/kop.lat\/blog\/wp-json\/wp\/v2\/posts\/316\/revisions\/318"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kop.lat\/blog\/wp-json\/wp\/v2\/media\/278"}],"wp:attachment":[{"href":"https:\/\/kop.lat\/blog\/wp-json\/wp\/v2\/media?parent=316"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kop.lat\/blog\/wp-json\/wp\/v2\/categories?post=316"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kop.lat\/blog\/wp-json\/wp\/v2\/tags?post=316"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}