{"id":1947,"date":"2023-08-13T03:46:23","date_gmt":"2023-08-13T10:46:23","guid":{"rendered":"https:\/\/gantovnik.com\/bio-tips\/?p=1947"},"modified":"2023-08-13T03:46:23","modified_gmt":"2023-08-13T10:46:23","slug":"387-replot-in-seaborn-library","status":"publish","type":"post","link":"https:\/\/gantovnik.com\/bio-tips\/2023\/08\/387-replot-in-seaborn-library\/","title":{"rendered":"#387 Replot() in seaborn library"},"content":{"rendered":"<p><a href=\"https:\/\/gantovnik.com\/bio-tips\/2023\/08\/387-replot-in-seaborn-library\/ex387\/\" rel=\"attachment wp-att-1948\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2023\/08\/ex387.png?resize=1080%2C500&#038;ssl=1\" alt=\"\" width=\"1080\" height=\"500\" class=\"alignnone size-full wp-image-1948\" srcset=\"https:\/\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2023\/08\/ex387.png 1080w, https:\/\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2023\/08\/ex387-980x454.png 980w, https:\/\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2023\/08\/ex387-480x222.png 480w\" sizes=\"(min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) and (max-width: 980px) 980px, (min-width: 981px) 1080px, 100vw\" \/><\/a><\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\n#Replot() in seaborn library\r\nimport matplotlib.pyplot as plt\r\n#conda install -c anaconda seaborn\r\nimport seaborn as sns\r\n# Apply the default theme\r\nsns.set_theme()\r\n\r\ndef main():\r\n    # Load an example dataset\r\n    tips = sns.load_dataset(&quot;tips&quot;)\r\n    # Create a visualization\r\n    sns.relplot(\r\n    data=tips,\r\n    x=&quot;total_bill&quot;, y=&quot;tip&quot;, col=&quot;time&quot;,\r\n    hue=&quot;smoker&quot;, style=&quot;smoker&quot;, size=&quot;size&quot;,\r\n)\r\n    plt.savefig(&quot;ex387.png&quot;, dpi=100)\r\n    plt.show()\r\n\r\nif __name__ == '__main__':\r\n    main()\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>#Replot() in seaborn library import matplotlib.pyplot as plt #conda install -c anaconda seaborn import seaborn as sns # Apply the default theme sns.set_theme() def main(): # Load an example dataset tips = sns.load_dataset(&quot;tips&quot;) # Create a visualization sns.relplot( data=tips, x=&quot;total_bill&quot;, y=&quot;tip&quot;, col=&quot;time&quot;, hue=&quot;smoker&quot;, style=&quot;smoker&quot;, size=&quot;size&quot;, ) plt.savefig(&quot;ex387.png&quot;, dpi=100) plt.show() if __name__ == &#8216;__main__&#8217;: main()<\/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":[91,2,92],"tags":[],"class_list":["post-1947","post","type-post","status-publish","format-standard","hentry","category-plot","category-python","category-seaborn"],"modified_by":"gantovnik","jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8bH0k-vp","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":1917,"url":"https:\/\/gantovnik.com\/bio-tips\/2023\/08\/374-hexbin-plot-with-marginal-distributions-using-seaborn-library\/","url_meta":{"origin":1947,"position":0},"title":"#374 Hexbin plot with marginal distributions using seaborn library","author":"gantovnik","date":"2023-08-10","format":false,"excerpt":"[code language=\"python\"] import numpy as np import matplotlib.pyplot as plt #conda install -c anaconda seaborn import seaborn as sns sns.set_theme(style=\"ticks\") def main(): rs = np.random.RandomState(11) x = rs.gamma(2, size=1000) y = -.5 * x + rs.normal(size=1000) sns.jointplot(x=x, y=y, kind=\"hex\", color=\"#4CB323\") plt.savefig(\"ex374.png\", dpi=100) plt.show() if __name__ == '__main__': main() [\/code]","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\/ex374.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2023\/08\/ex374.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2023\/08\/ex374.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":1943,"url":"https:\/\/gantovnik.com\/bio-tips\/2023\/08\/385-scatterplot-matrix-using-seaborn-library\/","url_meta":{"origin":1947,"position":1},"title":"#385 Scatterplot matrix using seaborn library","author":"gantovnik","date":"2023-08-13","format":false,"excerpt":"[code language=\"python\"] #Scatterplot matrix using seaborn library import matplotlib.pyplot as plt #conda install -c anaconda seaborn import seaborn as sns sns.set_theme(style=\"ticks\") def main(): df = sns.load_dataset(\"penguins\") sns.pairplot(df, hue=\"species\") plt.savefig(\"ex385.png\", dpi=100) plt.show() if __name__ == '__main__': main() [\/code]","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\/ex385.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2023\/08\/ex385.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2023\/08\/ex385.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2023\/08\/ex385.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2023\/08\/ex385.png?resize=1050%2C600&ssl=1 3x"},"classes":[]},{"id":1940,"url":"https:\/\/gantovnik.com\/bio-tips\/2023\/08\/384-linear-regression-with-marginal-distributions-using-seaborn-library\/","url_meta":{"origin":1947,"position":2},"title":"#384 Linear regression with marginal distributions using seaborn library","author":"gantovnik","date":"2023-08-11","format":false,"excerpt":"[code language=\"python\"] #Linear regression with marginal distributions using seaborn library import matplotlib.pyplot as plt #conda install -c anaconda seaborn import seaborn as sns sns.set_theme(style=\"darkgrid\") def main(): tips = sns.load_dataset(\"tips\") g = sns.jointplot(x=\"total_bill\", y=\"tip\", data=tips, kind=\"reg\", truncate=False, xlim=(0, 60), ylim=(0, 12), color=\"m\", height=7) plt.savefig(\"ex384.png\", dpi=100) plt.show() if __name__ == '__main__': main()\u2026","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\/ex384.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2023\/08\/ex384.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2023\/08\/ex384.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2023\/08\/ex384.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":1931,"url":"https:\/\/gantovnik.com\/bio-tips\/2023\/08\/380-joint-kernel-density-estimate-using-seaborn-library\/","url_meta":{"origin":1947,"position":3},"title":"#380 Joint kernel density estimate using seaborn library","author":"gantovnik","date":"2023-08-10","format":false,"excerpt":"[code language=\"python\"] #Joint kernel density estimate using seaborn library import matplotlib.pyplot as plt #conda install -c anaconda seaborn import seaborn as sns sns.set_theme(style=\"ticks\") def main(): # Load the penguins dataset penguins = sns.load_dataset(\"penguins\") # Show the joint distribution using kernel density estimation g = sns.jointplot( data=penguins, x=\"bill_length_mm\", y=\"bill_depth_mm\", hue=\"species\", kind=\"kde\"\u2026","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\/ex380.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2023\/08\/ex380.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2023\/08\/ex380.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":1945,"url":"https:\/\/gantovnik.com\/bio-tips\/2023\/08\/386-lineplot-from-a-wide-form-dataset-using-seaborn-library\/","url_meta":{"origin":1947,"position":4},"title":"#386 Lineplot from a wide-form dataset using seaborn library","author":"gantovnik","date":"2023-08-13","format":false,"excerpt":"[code language=\"python\"] #Lineplot from a wide-form dataset using seaborn library import numpy as np import pandas as pd import matplotlib.pyplot as plt #conda install -c anaconda seaborn import seaborn as sns sns.set_theme(style=\"whitegrid\") def main(): rs = np.random.RandomState(365) values = rs.randn(365, 4).cumsum(axis=0) dates = pd.date_range(\"1 1 2016\", periods=365, freq=\"D\") data =\u2026","rel":"","context":"In &quot;pandas&quot;","block_context":{"text":"pandas","link":"https:\/\/gantovnik.com\/bio-tips\/category\/pandas\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2023\/08\/ex386.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2023\/08\/ex386.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2023\/08\/ex386.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":1921,"url":"https:\/\/gantovnik.com\/bio-tips\/2023\/08\/376-scatterplot-with-continuous-hues-and-sizes-using-seaborn-library\/","url_meta":{"origin":1947,"position":5},"title":"#376 Scatterplot with continuous hues and sizes using seaborn library","author":"gantovnik","date":"2023-08-10","format":false,"excerpt":"[code language=\"python\"] #Scatterplot with continuous hues and sizes import matplotlib.pyplot as plt #conda install -c anaconda seaborn import seaborn as sns sns.set_theme(style=\"whitegrid\") def main(): # Load the example planets dataset planets = sns.load_dataset(\"planets\") cmap = sns.cubehelix_palette(rot=-.2, as_cmap=True) g = sns.relplot( data=planets, x=\"distance\", y=\"orbital_period\", hue=\"year\", size=\"mass\", palette=cmap, sizes=(10, 200), ) g.set(xscale=\"log\",\u2026","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\/ex376.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2023\/08\/ex376.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2023\/08\/ex376.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/posts\/1947","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=1947"}],"version-history":[{"count":0,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/posts\/1947\/revisions"}],"wp:attachment":[{"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/media?parent=1947"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/categories?post=1947"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/tags?post=1947"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}