{"id":114,"date":"2019-01-03T19:42:09","date_gmt":"2019-01-03T19:42:09","guid":{"rendered":"http:\/\/gantovnik.com\/bio-tips\/?p=114"},"modified":"2019-01-03T19:42:09","modified_gmt":"2019-01-03T19:42:09","slug":"figure-with-no-inter-subplot-spacing","status":"publish","type":"post","link":"https:\/\/gantovnik.com\/bio-tips\/2019\/01\/figure-with-no-inter-subplot-spacing\/","title":{"rendered":"Figure with no inter-subplot spacing"},"content":{"rendered":"<pre>import os\nimport matplotlib.pyplot as plt\nfrom numpy.random import randn\nos.chdir(r'D:\\data\\scripts\\web1\\ex21')\nos.getcwd()\nfig,ax = plt.subplots(2,2,sharex=True,sharey=True)\nfor i in range(2):\n    for j in range (2):\n        ax[i,j].hist(randn(500),bins=50,color='k',alpha=0.5)\nplt.subplots_adjust(wspace=0,hspace=0)\nfig.suptitle('Figure with no inter-subplot spacing')\nplt.savefig(\"example21.png\", dpi=100)\nplt.show()\nplt.close()\n\n<img data-recalc-dims=\"1\" decoding=\"async\" class=\"  wp-image-115 aligncenter\" src=\"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2019\/01\/example21.png?resize=566%2C377\" alt=\"example21\" width=\"566\" height=\"377\" srcset=\"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2019\/01\/example21.png?w=600&amp;ssl=1 600w, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2019\/01\/example21.png?resize=300%2C200&amp;ssl=1 300w\" sizes=\"(max-width: 566px) 100vw, 566px\" \/><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>import os import matplotlib.pyplot as plt from numpy.random import randn os.chdir(r&#8217;D:\\data\\scripts\\web1\\ex21&#8242;) os.getcwd() fig,ax = plt.subplots(2,2,sharex=True,sharey=True) for i in range(2): for j in range (2): ax[i,j].hist(randn(500),bins=50,color=&#8217;k&#8217;,alpha=0.5) plt.subplots_adjust(wspace=0,hspace=0) fig.suptitle(&#8216;Figure with no inter-subplot spacing&#8217;) plt.savefig(&#8220;example21.png&#8221;, dpi=100) 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-114","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-1Q","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":1188,"url":"https:\/\/gantovnik.com\/bio-tips\/2021\/11\/204-mandelbrot-fractal-using-python-2-2-2-2\/","url_meta":{"origin":114,"position":0},"title":"#208 Scatter plot with histograms using python","author":"gantovnik","date":"2021-11-27","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\/2021\/11\/ex208.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2021\/11\/ex208.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2021\/11\/ex208.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":197,"url":"https:\/\/gantovnik.com\/bio-tips\/2019\/01\/julia-fractal\/","url_meta":{"origin":114,"position":1},"title":"Julia fractal","author":"gantovnik","date":"2019-01-10","format":false,"excerpt":"import os import numba import numpy as np import matplotlib.pyplot as plt os.chdir(r'D:\\projects\\wordpress\\ex40') os.getcwd() def py_julia_fractal(z_re, z_im, j): for m in range(len(z_re)): for n in range(len(z_im)): z = z_re[m] + 1j * z_im[n] for t in range(256): z = z ** 2 - 0.05 + 0.68j if np.abs(z) > 2.0:\u2026","rel":"","context":"In &quot;python&quot;","block_context":{"text":"python","link":"https:\/\/gantovnik.com\/bio-tips\/category\/python\/"},"img":{"alt_text":"example40","src":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2019\/01\/example40.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2019\/01\/example40.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2019\/01\/example40.png?resize=525%2C300 1.5x"},"classes":[]},{"id":355,"url":"https:\/\/gantovnik.com\/bio-tips\/2019\/01\/bivariate-spline\/","url_meta":{"origin":114,"position":2},"title":"Bivariate Spline","author":"gantovnik","date":"2019-01-28","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\/example58.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2019\/01\/example58.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2019\/01\/example58.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":1915,"url":"https:\/\/gantovnik.com\/bio-tips\/2023\/08\/373-scatterplot-with-multiple-semantics-using-seaborn-library\/","url_meta":{"origin":114,"position":3},"title":"#373 Scatterplot with multiple semantics using seaborn library","author":"gantovnik","date":"2023-08-09","format":false,"excerpt":"","rel":"","context":"In &quot;plot&quot;","block_context":{"text":"plot","link":"https:\/\/gantovnik.com\/bio-tips\/category\/plot\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2023\/08\/ex373.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2023\/08\/ex373.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2023\/08\/ex373.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2023\/08\/ex373.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2023\/08\/ex373.png?resize=1050%2C600&ssl=1 3x"},"classes":[]},{"id":151,"url":"https:\/\/gantovnik.com\/bio-tips\/2019\/01\/direction-fields\/","url_meta":{"origin":114,"position":4},"title":"Direction fields","author":"gantovnik","date":"2019-01-07","format":false,"excerpt":"","rel":"","context":"In &quot;python&quot;","block_context":{"text":"python","link":"https:\/\/gantovnik.com\/bio-tips\/category\/python\/"},"img":{"alt_text":"example32","src":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2019\/01\/example32.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2019\/01\/example32.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2019\/01\/example32.png?resize=525%2C300 1.5x"},"classes":[]},{"id":383,"url":"https:\/\/gantovnik.com\/bio-tips\/2019\/02\/annotating-text\/","url_meta":{"origin":114,"position":5},"title":"#55 Annotating text in matplotlib plot","author":"gantovnik","date":"2019-02-12","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\/02\/example64_1.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2019\/02\/example64_1.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2019\/02\/example64_1.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/posts\/114","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=114"}],"version-history":[{"count":0,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/posts\/114\/revisions"}],"wp:attachment":[{"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/media?parent=114"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/categories?post=114"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/tags?post=114"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}