{"id":81568,"date":"2026-07-25T02:59:00","date_gmt":"2026-07-24T18:59:00","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/81568.html"},"modified":"2026-07-25T02:59:00","modified_gmt":"2026-07-24T18:59:00","slug":"%e3%80%90seaborn-%e5%ad%a6%e4%b9%a0%e7%ac%94%e8%ae%b0%e3%80%91p1-%e6%95%a3%e7%82%b9%e5%9b%be-scatterplot%e3%80%81%e6%8a%98%e7%ba%bf%e5%9b%be-lineplot%e3%80%81%e5%85%b3%e7%b3%bb%e5%9b%be-relplot","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/81568.html","title":{"rendered":"\u3010Seaborn \u5b66\u4e60\u7b14\u8bb0\u3011P1. \u6563\u70b9\u56fe scatterplot\u3001\u6298\u7ebf\u56fe lineplot\u3001\u5173\u7cfb\u56fe relplot"},"content":{"rendered":"<p><span style=\"color:null\">matplotlib \u753b\u56fe&#xff0c;seaborn \u753b\u53d8\u91cf\u5173\u7cfb<\/span><\/p>\n<p><span style=\"color:null\">seaborn <span style=\"background-color:#ffd900\">\u672c\u8d28\u4e0a\u662f\u5728 matplotlib \u7684\u753b\u5e03\u4e0a\u753b\u56fe&#xff0c;\u5747\u4f7f\u7528 plt.show() \u6765\u663e\u793a\u7ed8\u5236\u7684\u56fe\u50cf<\/span><\/span><\/p>\n<hr \/>\n<h2><span style=\"color:null\">\u5b89\u88c5 Seaborn<\/span><\/h2>\n<p><span style=\"color:null\">\u4f7f\u7528 pip \u5b89\u88c5&#xff1a;<\/span><\/p>\n<p>pip install seaborn<\/p>\n<p><span style=\"color:null\">\u6ce8\u610f&#xff1a; Seaborn \u4f9d\u8d56 pandas &#043; matplotlib &#043; numpy&#xff0c;\u5b89\u88c5 seaborn \u65f6\u4f1a\u4e00\u5e76\u5b89\u88c5\u8fd9\u4e9b\u4f9d\u8d56<\/span><\/p>\n<hr \/>\n<h2><span style=\"color:null\">\u5728 Python \u4e2d\u5bfc\u5165 Seaborn \u5e93<\/span><\/h2>\n<p><span style=\"color:null\">\u5bfc\u5165\u5e76\u53d6\u522b\u540d\u4e3a sns&#xff1a;<\/span><\/p>\n<p>import seaborn as sns<\/p>\n<hr \/>\n<h2><span style=\"color:null\">\u52a0\u8f7d Seaborn \u5185\u7f6e\u6570\u636e\u96c6<\/span><\/h2>\n<p><span style=\"color:null\">Seaborn \u62e5\u6709\u5185\u7f6e\u6570\u636e\u96c6&#xff0c;\u53ef\u4ee5\u76f4\u63a5\u52a0\u8f7d&#xff0c;\u8fd4\u56de DataFrame \u7c7b\u578b\u7684\u6570\u636e\u96c6<\/span><\/p>\n<h3><span style=\"color:null\">1. \u67e5\u770b\u5185\u7f6e\u6570\u636e\u96c6<\/span><\/h3>\n<p>import seaborn as sns<br \/>\ndataset_names &#061; sns.get_dataset_names()<br \/>\nprint(dataset_names)<\/p>\n<p><span style=\"color:null\">\u8fd4\u56de\u5982\u4e0b\u7ed3\u679c&#xff1a;<\/span><\/p>\n<p><span style=\"color:null\">[&#039;anagrams&#039;, &#039;anscombe&#039;, &#039;attention&#039;, &#039;brain_networks&#039;, &#039;car_crashes&#039;, &#039;diamonds&#039;, &#039;dots&#039;, &#039;dowjones&#039;, &#039;exercise&#039;, &#039;flights&#039;, &#039;fmri&#039;, &#039;geyser&#039;, &#039;glue&#039;, &#039;healthexp&#039;, &#039;iris&#039;, &#039;mpg&#039;, &#039;penguins&#039;, &#039;planets&#039;, &#039;seaice&#039;, &#039;taxis&#039;, &#039;tips&#039;, &#039;titanic&#039;]<\/span><\/p>\n<h3><span style=\"color:null\">2. \u52a0\u8f7d\u6570\u636e\u96c6<\/span><\/h3>\n<p><span style=\"color:null\">\u8fd4\u56de\u7684\u662f pandas \u7684 DataFrame \u6570\u636e\u7c7b\u578b<\/span><\/p>\n<p>import seaborn as sns<\/p>\n<p># \u4f8b\u5982\u52a0\u8f7d iris \u6570\u636e\u96c6<br \/>\ndf &#061; sns.load_dataset(&#039;iris&#039;)   # \u8fd4\u56de DataFrame \u6570\u636e\u7c7b\u578b<\/p>\n<p># \u67e5\u770b\u524d\u4e94\u6761\u8bb0\u5f55<br \/>\nprint(df.head())<\/p>\n<p><span style=\"color:null\">\u7ed3\u679c\u5982\u4e0b&#xff1a;<\/span><\/p>\n<p><span style=\"color:null\">\u00a0 \u00a0sepal_length \u00a0sepal_width \u00a0petal_length \u00a0petal_width species<br \/>\n0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 5.1 \u00a0 \u00a0 \u00a0 \u00a0 \u00a03.5 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 1.4 \u00a0 \u00a0 \u00a0 \u00a0 \u00a00.2 \u00a0setosa<br \/>\n1 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 4.9 \u00a0 \u00a0 \u00a0 \u00a0 \u00a03.0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 1.4 \u00a0 \u00a0 \u00a0 \u00a0 \u00a00.2 \u00a0setosa<br \/>\n2 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 4.7 \u00a0 \u00a0 \u00a0 \u00a0 \u00a03.2 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 1.3 \u00a0 \u00a0 \u00a0 \u00a0 \u00a00.2 \u00a0setosa<br \/>\n3 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 4.6 \u00a0 \u00a0 \u00a0 \u00a0 \u00a03.1 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 1.5 \u00a0 \u00a0 \u00a0 \u00a0 \u00a00.2 \u00a0setosa<br \/>\n4 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 5.0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a03.6 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 1.4 \u00a0 \u00a0 \u00a0 \u00a0 \u00a00.2 \u00a0setosa<\/span><\/p>\n<hr \/>\n<h2><span style=\"color:null\">\u6563\u70b9\u56fe\u7ed8\u5236 sns.scatterplot<\/span><\/h2>\n<p>sns.scatterplot(<br \/>\n    data&#061;df,    # \u6570\u636e<br \/>\n    x&#061;&#039;\u6a2a\u8f74\u53d8\u91cf\u7279\u5f81&#039;,    # \u6a2a\u8f74\u53d8\u91cf<br \/>\n    y&#061;&#039;\u7eb5\u8f74\u53d8\u91cf\u7279\u5f81&#039;,    # \u7eb5\u8f74\u53d8\u91cf<br \/>\n    hue&#061;&#039;\u989c\u8272\u5206\u7ec4\u7279\u5f81&#039;,    # \u6309\u8be5\u5217\u6620\u5c04\u989c\u8272<br \/>\n    style&#061;&#039;\u5f62\u72b6\u5206\u7ec4\u7279\u5f81&#039;,    # \u6309\u8be5\u5217\u6620\u5c04\u6807\u8bb0\u5f62\u72b6<br \/>\n    size&#061;&#039;\u70b9\u5927\u5c0f\u6620\u5c04\u7279\u5f81&#039;,    # \u6309\u8be5\u5217\u6620\u5c04\u70b9\u7684\u5927\u5c0f<br \/>\n    s&#061;60,    # \u56fa\u5b9a\u70b9\u5927\u5c0f&#xff08;\u82e5\u540c\u65f6\u4f7f\u7528 size \u53c2\u6570&#xff0c;s \u5c06\u88ab\u5ffd\u7565&#xff0c;\u63a8\u8350\u4e8c\u9009\u4e00&#xff09;<br \/>\n    alpha&#061;0.7,    # \u900f\u660e\u5ea6<br \/>\n    ax&#061;ax    # \u6307\u5b9a\u5b50\u56fe<br \/>\n)<\/p>\n<p><span style=\"color:null\">\u6bcf\u6761\u8bb0\u5f55\u5bf9\u5e94\u4e00\u4e2a\u70b9<\/span><\/p>\n<p><span style=\"color:null\">seaborn \u7684 sns.scatterplot \u76f8\u6bd4 matplotlib \u7684 plt.scatter \u591a\u4e86\u4e09\u4e2a\u5173\u952e\u7edf\u8ba1\u8bed\u4e49&#xff1a;<\/span><\/p>\n<li><span style=\"color:null\">hue&#xff1a;\u5206\u7ec4&#xff0c;\u6307\u5b9a\u4e00\u4e2a\u7279\u5f81\u7ed9 hue&#xff0c;\u5bf9\u4e8e\u4e0d\u540c\u7684\u8be5\u7279\u5f81&#xff0c;\u7ed8\u5236\u7684\u70b9\u6620\u5c04\u4e0d\u540c\u989c\u8272<\/span><\/li>\n<li><span style=\"color:null\">style&#xff1a;\u70b9\u7684\u6837\u5f0f&#xff0c;\u6307\u5b9a\u4e00\u4e2a\u7279\u5f81\u7ed9 style&#xff0c;\u5bf9\u4e8e\u4e0d\u540c\u7684\u8be5\u7279\u5f81&#xff0c;\u7ed8\u5236\u7684\u70b9\u4f1a\u4f7f\u7528\u4e0d\u540c\u7684\u6837\u5f0f\u3002\u7528\u4e8e\u533a\u5206\u7b2c\u4e8c\u5206\u7c7b\u7ef4\u5ea6<\/span><\/li>\n<li><span style=\"color:null\">size&#xff1a;\u70b9\u7684\u5927\u5c0f&#xff0c;\u6307\u5b9a\u4e00\u4e2a\u7279\u5f81\u7ed9 size&#xff0c;\u82e5\u4e00\u6761\u8bb0\u5f55\u7684\u8be5\u7279\u5f81\u8d8a\u5927&#xff0c;\u7ed8\u5236\u7684\u70b9\u4e5f\u5c31\u8d8a\u5927<\/span><\/li>\n<h3><span style=\"color:null\">\u793a\u4f8b<\/span><\/h3>\n<p><span style=\"color:null\">\u7ed8\u5236 penguins \u6570\u636e\u96c6\u4e2d\u4f01\u9e45\u7684\u9ccd\u957f&#xff08;flipper_length_mm&#xff09;\u5173\u4e8e\u4f53\u91cd&#xff08;body_mass_g&#xff09;\u7684\u6563\u70b9\u56fe\u3002\u9996\u5148\u52a0\u8f7d\u6570\u636e\u96c6&#xff1a;<\/span><\/p>\n<p>import seaborn as sns<\/p>\n<p># \u52a0\u8f7d\u6570\u636e\u96c6<br \/>\ndf &#061; sns.load_dataset(&#039;penguins&#039;)<br \/>\ndf.head()<\/p>\n<p><span style=\"color:null\">peguins \u6570\u636e\u96c6\u5f62\u5982&#xff1a;<\/span><\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"285\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260724185854-6a63b5eeb6295.png\" width=\"1044\" \/><\/p>\n<\/p>\n<p><span style=\"color:null\">1. \u7ed8\u5236\u4e00\u4e2a\u666e\u901a\u7684\u6563\u70b9\u56fe<\/span><\/p>\n<p># \u7ed8\u5236\u6563\u70b9\u56fe<br \/>\nsns.scatterplot(data&#061;df, x&#061;&#039;flipper_length_mm&#039;, y&#061;&#039;body_mass_g&#039;)<br \/>\n# seaborn \u5728\u7ed8\u56fe\u524d\u4f1a\u8c03\u7528 dropna()&#xff0c;\u81ea\u52a8\u5220\u9664 x \/ y \/ hue \/ style \/ size \u4e2d\u542b\u6709 NaN \u7684\u884c<\/p>\n<p>plt.show()    # \u4f7f\u7528 mpl \u6765\u663e\u793a\u56fe\u7247 -&gt; sns \u5728 mpl \u7684\u753b\u5e03\u4e0a\u753b\u56fe&#xff0c;\u7531 mpl \u6765\u663e\u793a\u56fe\u7247<\/p>\n<p><span style=\"color:null\">\u7ed8\u56fe\u7ed3\u679c\u5982\u4e0b&#xff1a;<\/span><\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"433\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260724185854-6a63b5eedb51f.png\" width=\"581\" \/><\/p>\n<\/p>\n<p><span style=\"color:null\">2. \u52a0\u5165\u53c2\u6570\u00a0hue&#xff0c;\u5bf9\u6307\u5b9a\u7279\u5f81\u4e0d\u540c\u7684\u8bb0\u5f55\u5728\u753b\u56fe\u65f6\u6620\u5c04\u4e0d\u540c\u7684\u989c\u8272<\/span><\/p>\n<p># \u52a0\u5165\u5206\u7c7b\u53d8\u91cf hue<br \/>\nsns.scatterplot(<br \/>\n    data&#061;df,<br \/>\n    x&#061;&#039;flipper_length_mm&#039;,<br \/>\n    y&#061;&#039;body_mass_g&#039;,<br \/>\n    hue&#061;&#039;species&#039;   # \u5c06\u5bf9\u6bcf\u4e2a\u70b9\u6839\u636e\u5176 species \u6807\u6ce8\u4e0d\u540c\u989c\u8272<br \/>\n)<br \/>\n# \u6839\u636e hue \u6620\u5c04\u989c\u8272<br \/>\n# seaborn \u4f1a\u81ea\u52a8\u751f\u6210 legend<\/p>\n<p>plt.show()<\/p>\n<p><span style=\"color:null\">\u7ed8\u56fe\u7ed3\u679c\u5982\u4e0b&#xff1a;<\/span><\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"433\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260724185854-6a63b5eeecc4b.png\" width=\"581\" \/><\/p>\n<\/p>\n<p><span style=\"color:null\">3. \u52a0\u5165\u53c2\u6570 style&#xff0c;\u5bf9\u6307\u5b9a\u7279\u5f81\u4e0d\u540c\u7684\u8bb0\u5f55\u5728\u753b\u56fe\u65f6\u4f7f\u7528\u4e0d\u540c\u7684\u70b9\u7684\u6837\u5f0f<\/span><\/p>\n<p># \u518d\u52a0\u5165\u70b9\u7684\u6837\u5f0f style<br \/>\nsns.scatterplot(<br \/>\n    data&#061;df,<br \/>\n    x&#061;&#039;flipper_length_mm&#039;,<br \/>\n    y&#061;&#039;body_mass_g&#039;,<br \/>\n    hue&#061;&#039;species&#039;,   # \u5c06\u5bf9\u6bcf\u4e2a\u70b9\u6839\u636e\u5176 species \u6807\u6ce8\u4e0d\u540c\u989c\u8272<br \/>\n    style&#061;&#039;sex&#039; # \u5c06\u5bf9\u6bcf\u4e2a\u70b9\u6839\u636e\u5176 sex \u9009\u62e9\u4e0d\u540c\u7684\u70b9\u7684\u6837\u5f0f<br \/>\n)<br \/>\n# \u6839\u636e style \u9009\u62e9\u4e0d\u540c\u6807\u8bb0<br \/>\n# \u9002\u5408\u5728 hue \u7684\u57fa\u7840\u4e0a\u8fdb\u884c\u4e8c\u6b21\u5206\u7c7b\u7684\u60c5\u5f62<\/p>\n<p>plt.show()<\/p>\n<p><span style=\"color:null\">\u7ed8\u56fe\u7ed3\u679c\u5982\u4e0b&#xff1a;<\/span><\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"433\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260724185855-6a63b5ef0a60d.png\" width=\"581\" \/><\/p>\n<\/p>\n<hr \/>\n<h2><span style=\"color:null\">\u4f7f\u7528 Axes \u5bf9\u8c61\u7cbe\u7ec6\u5316\u63a7\u5236<\/span><\/h2>\n<p><span style=\"color:null\">Seaborn \u7684\u5927\u90e8\u5206\u7ed8\u56fe\u51fd\u6570\u90fd\u4f1a\u8fd4\u56de\u4e00\u4e2a matplotlib.axes.Axes \u5bf9\u8c61&#xff0c;\u56e0\u6b64\u4e0d\u9700\u8981\u663e\u793a\u521b\u5efa\u753b\u5e03\u5c31\u53ef\u4ee5\u62ff\u5230\u7ed8\u56fe\u540e\u7684 Axes&#xff0c;\u5e76\u901a\u8fc7\u8fd9\u4e2a Axes \u5bf9\u7ed8\u5236\u7684\u56fe\u5f62\u8fdb\u884c\u7cbe\u7ec6\u5316\u63a7\u5236\u3002<\/span><\/p>\n<h3><span style=\"color:null\">Axes \u5bf9\u8c61\u6709\u5173\u65b9\u6cd5<\/span><\/h3>\n<table align=\"center\" border=\"1\" cellpadding=\"1\" cellspacing=\"1\" style=\"width:500px\">\n<tr><span style=\"color:null\">\u65b9\u6cd5<\/span><span style=\"color:null\">\u529f\u80fd<\/span><\/tr>\n<tbody>\n<tr>\n<td style=\"width:400px\"><span style=\"color:null\">ax.set_title(&#039;\u6807\u9898&#039;)<\/span><\/td>\n<td style=\"width:98px\"><span style=\"color:null\">\u6807\u9898<\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"width:400px\">\n<p><span style=\"color:null\">ax.set_xlabel(&#039;x\u8f74\u6807\u7b7e&#039;)<\/span><\/p>\n<p><span style=\"color:null\">ax.set_ylabel(&#039;y\u8f74\u6807\u7b7e&#039;)<\/span><\/p>\n<\/td>\n<td style=\"width:98px\"><span style=\"color:null\">\u5750\u6807\u8f74\u6807\u7b7e<\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"width:400px\">\n<p><span style=\"color:null\">ax.set_xlim(left&#061;&#8230;, right&#061;&#8230;)<\/span><\/p>\n<p><span style=\"color:null\">ax.set_ylim(bottom&#061;&#8230;, top&#061;&#8230;)<\/span><\/p>\n<\/td>\n<td style=\"width:98px\"><span style=\"color:null\">\u5750\u6807\u8f74\u8303\u56f4<\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"width:400px\">\n<p><span style=\"color:null\">ax.set_xticks(x\u503c\u7684\u5e8f\u5217)<\/span><\/p>\n<p><span style=\"color:null\">ax.set_yticks(y\u503c\u7684\u5e8f\u5217)<\/span><\/p>\n<\/td>\n<td style=\"width:98px\"><span style=\"color:null\">\u523b\u5ea6<\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"width:400px\">\n<p><span style=\"color:null\">ax.legend(title&#061;&#039;\u56fe\u4f8b\u6807\u9898&#039;, loc&#061;&#039;best&#039;)<\/span><\/p>\n<p><span style=\"color:null\">loc\u00a0\u8868\u793a\u56fe\u4f8b\u7684\u4f4d\u7f6e&#xff0c;\u8fd8\u53ef\u4e3a &#xff1a;<\/span><\/p>\n<p><span style=\"color:null\">1.\u00a0\u6700\u4f73\u4f4d\u7f6e&#xff1a;&#039;best&#039;&#xff0c;\u81ea\u52a8\u9009\u6700\u4e0d\u6321\u6570\u636e\u7684\u4f4d\u7f6e&#xff08;\u5df2\u9010\u6b65\u88ab\u5f03\u7528&#xff0c;\u5efa\u8bae\u663e\u5f0f\u6307\u5b9a\u4f4d\u7f6e&#xff09;<\/span><\/p>\n<p><span style=\"color:null\">2.\u00a0\u56db\u4e2a\u89d2\u4e0e\u56db\u6761\u8fb9\u4e2d\u95f4&#xff1a;&#039;upper&#039;, &#039;lower&#039;, &#039;center&#039; \u4e0e &#039;left&#039;, &#039;right&#039;, &#039;center&#039; \u7684\u7ec4\u5408&#xff08;\u4e2d\u95f4\u7528\u7a7a\u683c\u9694\u5f00&#xff09;&#xff0c;\u4f8b\u5982 &#039;upper center&#039; \u8868\u793a\u4e0a\u65b9\u5c45\u4e2d<\/span><\/p>\n<p><span style=\"color:null\">3. \u5750\u6807\u7cfb\u6b63\u4e2d\u95f4&#xff1a;&#039;center&#039;&#xff0c;\u5bb9\u6613\u6321\u4f4f\u6570\u636e<\/span><\/p>\n<\/td>\n<td style=\"width:98px\"><span style=\"color:null\">\u56fe\u4f8b<\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"width:400px\">\n<p><span style=\"color:null\">ax.grid(True)\u00a0 \u00a0 \u00a0 \u00a0 # x\u3001y\u8f74\u7f51\u683c\u7ebf<\/span><\/p>\n<p><span style=\"color:null\">ax.grid(True, axis&#061;&#039;x&#039;)\u00a0 \u00a0 \u00a0 \u00a0 # \u4ec5 x \u8f74\u7f51\u683c\u7ebf<\/span><\/p>\n<p><span style=\"color:null\">ax.grid(True, axis&#061;&#039;y&#039;)\u00a0 \u00a0 \u00a0 \u00a0 # \u4ec5 y \u8f74\u7f51\u683c\u7ebf<\/span><\/p>\n<\/td>\n<td style=\"width:98px\"><span style=\"color:null\">\u7f51\u683c<\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"width:400px\">\n<p><span style=\"color:null\">ax.axhline()<\/span><\/p>\n<p><span style=\"color:null\">ax.axvline()<\/span><\/p>\n<\/td>\n<td style=\"width:98px\"><span style=\"color:null\">\u53c2\u8003\u7ebf<\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"width:400px\">\n<p><span style=\"color:null\">ax.text()<\/span><\/p>\n<p><span style=\"color:null\">ax.annotate()<\/span><\/p>\n<\/td>\n<td style=\"width:98px\"><span style=\"color:null\">\u6587\u672c<\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"width:400px\">\n<p><span style=\"color:null\">ax.spines[]\u00a0 \u00a0 \u00a0 \u00a0 # \u7528\u5b57\u5178\u5f62\u5f0f\u5bf9\u67d0\u8fb9\u6846\u8fdb\u884c\u64cd\u4f5c<\/span><\/p>\n<p><span style=\"color:null\">\u5305\u62ec\u8fb9\u6846\u663e\u793a\u4e0e\u9690\u85cf\u3001\u7c97\u7ec6\u3001\u989c\u8272\u7b49<\/span><\/p>\n<p><span style=\"color:null\"># \u9690\u85cf\u4e0a\u3001\u53f3\u8fb9\u6846<\/span><\/p>\n<p><span style=\"color:null\">for spine in [&#039;top&#039;, &#039;right&#039;]:<\/span><\/p>\n<p><span style=\"color:null\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0ax.spines[spine].set_visible(False)<\/span><\/p>\n<\/td>\n<td style=\"width:98px\"><span style=\"color:null\">\u8fb9\u6846<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4><span style=\"color:null\">\u00a01. \u793a\u4f8b<\/span><\/h4>\n<p>import seaborn as sns<br \/>\nimport matplotlib as mpl<br \/>\nimport matplotlib.pyplot as plt<\/p>\n<p>df &#061; sns.load_dataset(&#039;penguins&#039;)<br \/>\ndf.head()<\/p>\n<p>mpl.rcParams[&#039;font.family&#039;] &#061; &#039;SimHei&#039;<br \/>\nmpl.rcParams[&#039;font.size&#039;] &#061; 15<\/p>\n<p># \u8fd9\u91cc\u5c06\u8fd4\u56de\u7684 Axes \u5bf9\u8c61\u5b58\u53d8\u91cf ax<br \/>\nax &#061; sns.scatterplot(<br \/>\n    data&#061;df,<br \/>\n    x&#061;&#039;flipper_length_mm&#039;,<br \/>\n    y&#061;&#039;body_mass_g&#039;,<br \/>\n    hue&#061;&#039;species&#039;<br \/>\n)<\/p>\n<p># \u6dfb\u52a0 x\u3001y \u8f74\u6807\u7b7e<br \/>\nax.set_xlabel(&#039;\u9ccd\u957f (mm)&#039;)<br \/>\nax.set_ylabel(&#039;\u4f53\u91cd (g)&#039;)<\/p>\n<p>ax.legend(title&#061;&#039;\u7269\u79cd&#039;) # \u4fee\u6539\u56fe\u4f8b\u6807\u9898<br \/>\nax.grid(True)   # \u7f51\u683c\u7ebf<\/p>\n<p>plt.show()<\/p>\n<p><span style=\"color:null\">\u7ed8\u56fe\u7ed3\u679c\u5982\u4e0b&#xff1a;<\/span><\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"446\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260724185855-6a63b5ef1c3f7.png\" width=\"596\" \/><\/p>\n<h4><span style=\"color:null\">2. \u56fe\u4f8b\u5916\u7f6e<\/span><\/h4>\n<p><span style=\"color:null\">\u82e5\u56fe\u4f8b\u5728\u56fe\u4e2d\u4f1a\u906e\u6321\u6570\u636e&#xff0c;\u53ef\u4ee5\u4f7f\u7528 ax.legend() \u65b9\u6cd5\u5c06\u5176\u653e\u5728\u56fe\u7684\u5916\u9762<\/span><\/p>\n<p><span style=\"color:null\"><span style=\"background-color:#ffd900\">\u8981\u914d\u5408 plt.tight_layout() \u4f7f\u7528&#xff0c;\u5426\u5219\u56fe\u4f8b\u53ef\u80fd\u4f1a\u8dd1\u51fa\u753b\u5e03<\/span><\/span><\/p>\n<p>ax.legend(<br \/>\n    title&#061;&#039;\u56fe\u4f8b\u6807\u9898&#039;,<br \/>\n    bbox_to_anchor&#061;(x\u5750\u6807, y\u5750\u6807),    # \u5bf9\u9f50\u5750\u6807&#xff0c;(0, 0) \u8868\u793a ax \u7684\u5de6\u4e0b\u89d2&#xff0c;(1, 1) \u8868\u793a ax \u7684\u53f3\u4e0a\u89d2<br \/>\n    loc&#061;&#039;\u5bf9\u9f50\u65b9\u5f0f&#039;    # \u6307\u5b9a\u56fe\u4f8b\u7684\u54ea\u4e2a\u89d2\u6216\u8fb9\u4e2d\u70b9\u4e0e\u8be5\u5750\u6807\u5bf9\u9f50<br \/>\n)<\/p>\n<p><span style=\"color:null\">\u4f8b\u5982&#xff1a;<\/span><\/p>\n<p><span style=\"color:null\">\u5c06\u56fe\u4f8b\u653e\u5728\u56fe\u7684\u53f3\u4fa7\u5e38\u7528\u5199\u6cd5&#xff1a;<\/span><\/p>\n<p>ax.legend(<br \/>\n    title&#061;&#039;\u56fe\u4f8b\u6807\u9898&#039;,<br \/>\n    bbox_to_anchor&#061;(1.02, 1),    # \u5bf9\u9f50\u5750\u6807&#xff0c;(1.02, 1)&#xff0c;\u8868\u793a\u56fe\u7684\u53f3\u4e0a\u89d2\u5f80\u53f30.02\u8ddd\u79bb\u7684\u70b9<br \/>\n    loc&#061;&#039;upper left&#039;    # \u6307\u5b9a\u56fe\u4f8b\u7684\u5de6\u4e0a\u89d2\u4e0e (1.02, 1) \u70b9\u5bf9\u9f50<br \/>\n)<\/p>\n<p><span style=\"color:null\">\u7ed3\u679c\u5f62\u5982&#xff1a;<\/span><\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"455\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260724185855-6a63b5ef2ea1d.png\" width=\"611\" \/><\/p>\n<p><span style=\"color:null\">\u4f7f\u7528 tight_layout(rect&#061;&#8230;) \u4e3a\u56fe\u4f8b\u9884\u7559\u7a7a\u95f4&#xff1a;<\/span><\/p>\n<p><span style=\"color:null\">\u4f8b\u5982&#xff1a;<\/span><\/p>\n<p><span style=\"color:null\">\u5728\u53f3\u4fa7\u9884\u7559\u56fe\u4f8b\u7a7a\u95f4<\/span><\/p>\n<p># rect&#061;[\u5de6\u8fb9\u8ddd, \u5e95\u8fb9\u8ddd, \u53f3\u8fb9\u8ddd, \u4e0a\u8fb9\u8ddd]&#xff0c;\u4f7f\u7528 figure \u5750\u6807\u7cfb&#xff08;0\u20131&#xff09;&#xff0c;\u6307\u5b9a\u4e00\u4e2a\u77e9\u5f62\u533a\u57df<br \/>\n# tight_layout \u4ec5\u5728 rect \u6307\u5b9a\u7684\u77e9\u5f62\u533a\u57df\u5185\u6392\u5e03\u5b50\u56fe<br \/>\nplt.tight_layout(rect&#061;(0, 0, 0.82, 1))    # \u53f3\u4fa7\u7559 18% \u7a7a\u95f4\u7ed9\u56fe\u4f8b&#xff0c;\u9632\u6b62 tight_layout \u5c06\u5176\u88c1\u6389<\/p>\n<hr \/>\n<h2><span style=\"color:null\">\u6563\u70b9\u56fe\u7ec3\u4e60<\/span><\/h2>\n<p><span style=\"color:null\">1. \u4f7f\u7528 penguins \u6570\u636e\u96c6&#xff0c;x \u8f74\u4e3a\u5599\u957f&#xff08;bill_length_mm&#xff09;&#xff0c;y \u8f74\u4e3a\u5599\u6df1&#xff08;bill_depth_mm&#xff09;\u5e76\u4e14\u6309\u00a0species\u00a0\u6620\u5c04\u989c\u8272\u753b\u51fa\u6563\u70b9\u56fe&#xff0c;\u52a0\u4e0a\u5408\u9002\u7684\u6807\u9898\u548c\u8f74\u6807\u7b7e&#xff0c;\u753b\u5728\u5b50\u56fe1<\/span><\/p>\n<p><span style=\"color:null\">2. \u5728 1 \u7684\u57fa\u7840\u4e0a\u7528 sex \u533a\u5206\u6027\u522b&#xff0c;\u753b\u5728\u5b50\u56fe2<\/span><\/p>\n<p><span style=\"color:null\">&#xff08;\u56fe\u4f8b\u653e\u5728\u56fe\u7684\u53f3\u4fa7\u4e2d\u90e8&#xff09;<\/span><\/p>\n<p># \u672c\u4eba\u601d\u8def&#xff0c;\u4ec5\u4f9b\u53c2\u8003<br \/>\nimport seaborn as sns<br \/>\nimport matplotlib as mpl<br \/>\nimport matplotlib.pyplot as plt<\/p>\n<p>df &#061; sns.load_dataset(&#039;penguins&#039;)<br \/>\ndf.head()<\/p>\n<p>mpl.rcParams[&#039;font.family&#039;] &#061; &#039;SimHei&#039;<br \/>\nmpl.rcParams[&#039;font.size&#039;] &#061; 15<\/p>\n<p># \u4f7f\u7528 2\u00d71 \u7684\u5782\u76f4\u5e03\u5c40&#xff0c;\u4fbf\u4e8e\u5bf9\u6bd4\u201c\u4ec5\u6309\u79cd\u7c7b\u7740\u8272\u201d\u4e0e\u201c\u6309\u79cd\u7c7b&#043;\u6027\u522b\u533a\u5206\u201d\u7684\u5dee\u5f02<br \/>\nfig, (ax1, ax2) &#061; plt.subplots(2, 1, figsize&#061;(12, 14), dpi&#061;100)    # \u540c\u65f6\u83b7\u5f97\u753b\u5e03 fig \u4e0e\u4e24\u5e45\u5b50\u56fe ax1, ax2<\/p>\n<p># \u5b50\u56fe1<br \/>\nsns.scatterplot(<br \/>\n    data&#061;df,<br \/>\n    x&#061;&#039;bill_length_mm&#039;,<br \/>\n    y&#061;&#039;bill_depth_mm&#039;,<br \/>\n    hue&#061;&#039;species&#039;,<br \/>\n    ax&#061;ax1<br \/>\n)<br \/>\nax1.set_title(&#039;\u5599\u957f-\u5599\u6df1 \u5bf9\u6bd4\u56fe&#039;)<br \/>\nax1.set_xlabel(&#039;\u5599\u957f (mm)&#039;)<br \/>\nax1.set_ylabel(&#039;\u5599\u6df1 (mm)&#039;)<br \/>\n# \u5c06\u56fe\u4f8b\u653e\u5230\u56fe\u7684\u53f3\u4fa7<br \/>\nax1.legend(<br \/>\n    title&#061;&#039;\u7269\u79cd&#039;,<br \/>\n    loc&#061;&#039;upper left&#039;,              # \u56fe\u4f8b\u7684\u5de6\u4e0a\u89d2<br \/>\n    bbox_to_anchor&#061;(1.02, 1)       # \u5bf9\u9f50\u5230 ax1 \u7684\u53f3\u4fa7<br \/>\n)<\/p>\n<p># \u5b50\u56fe2<br \/>\nsns.scatterplot(<br \/>\n    data&#061;df,<br \/>\n    x&#061;&#039;bill_length_mm&#039;,<br \/>\n    y&#061;&#039;bill_depth_mm&#039;,<br \/>\n    hue&#061;&#039;species&#039;,<br \/>\n    style&#061;&#039;sex&#039;,<br \/>\n    ax&#061;ax2<br \/>\n)<br \/>\nax2.set_title(&#039;\u5599\u957f-\u5599\u6df1 \u5bf9\u6bd4\u56fe&#039;)<br \/>\nax2.set_xlabel(&#039;\u5599\u957f (mm)&#039;)<br \/>\nax2.set_ylabel(&#039;\u5599\u6df1 (mm)&#039;)<br \/>\n# \u5c06\u56fe\u4f8b\u653e\u5230\u56fe\u7684\u53f3\u4fa7\u4e2d\u90e8<br \/>\nax2.legend(<br \/>\n    title&#061;&#039;\u7269\u79cd \/ \u6027\u522b&#039;,<br \/>\n    loc&#061;&#039;upper left&#039;,              # \u56fe\u4f8b\u7684\u5de6\u4e0a\u89d2<br \/>\n    bbox_to_anchor&#061;(1.02, 1)       # \u5bf9\u9f50\u5230 ax2 \u7684\u53f3\u4fa7<br \/>\n)<\/p>\n<p>plt.tight_layout(rect&#061;(0, 0, 0.82, 1))<br \/>\nplt.show()<\/p>\n<p><span style=\"color:null\">\u7ed8\u56fe\u7ed3\u679c\u5982\u4e0b&#xff1a;<\/span><\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1375\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260724185855-6a63b5ef40d1a.png\" width=\"953\" \/><\/p>\n<\/p>\n<hr \/>\n<h2><span style=\"color:null\">\u6298\u7ebf\u56fe\u7ed8\u5236 sns.lineplot<\/span><\/h2>\n<p>sns.lineplot(<br \/>\n    data&#061;df,    # \u6570\u636e<br \/>\n    x&#061;&#039;\u6a2a\u8f74\u53d8\u91cf\u7279\u5f81&#039;,    # \u6a2a\u8f74\u53d8\u91cf<br \/>\n    y&#061;&#039;\u7eb5\u8f74\u53d8\u91cf\u7279\u5f81&#039;,    # \u7eb5\u8f74\u53d8\u91cf<br \/>\n    hue&#061;&#039;\u989c\u8272\u5206\u7ec4\u7279\u5f81&#039;,    # \u6309\u8be5\u5217\u6620\u5c04\u989c\u8272<br \/>\n    style&#061;&#039;\u7ebf\u578b\u5206\u7ec4\u7279\u5f81&#039;,    # \u6309\u8be5\u5217\u6620\u5c04\u7ebf\u578b<br \/>\n    markers&#061;True,    # \u662f\u5426\u663e\u793a\u70b9<br \/>\n    dashes&#061;False,    # False&#xff1a;\u6240\u6709\u5206\u7ec4\u5747\u4e3a\u5b9e\u7ebf&#xff0c;True&#xff1a;\u4e0d\u540c\u5206\u7ec4\u4f7f\u7528\u4e0d\u540c\u865a\u7ebf\u6837\u5f0f&#xff08;Seaborn \u9ed8\u8ba4\u884c\u4e3a&#xff09;&#xff0c;\u4e5f\u53ef\u4f20\u5165\u5217\u8868\u6216\u5b57\u5178\u81ea\u5b9a\u4e49\u865a\u7ebf<br \/>\n    estimator&#061;&#039;mean&#039;,    # \u5bf9\u540c\u4e00 x \u4e0b\u7684\u591a\u4e2a y \u6c42\u5747\u503c&#xff08;\u9ed8\u8ba4\u503c&#xff0c;\u53ef\u7701\u7565&#xff09;&#xff0c;lineplot \u9ed8\u8ba4\u4f1a\u5bf9\u76f8\u540c x \u503c\u5bf9\u5e94\u7684\u591a\u4e2a y \u503c\u8fdb\u884c\u805a\u5408<br \/>\n    errorbar&#061;None,    # None \/ &#039;sd&#039; \/ (&#039;pi&#039;, 95)<br \/>\n    ax&#061;ax    # \u6307\u5b9a\u5b50\u56fe<br \/>\n)<\/p>\n<p><span style=\"color:null\">\u7ed8\u5236\u6298\u7ebf\u56fe\u65f6&#xff0c;\u82e5\u4e0d\u6307\u5b9a\u00a0errorbar&#061;None&#xff0c;\u5219\u9ed8\u8ba4\u81ea\u52a8\u751f\u6210\u7f6e\u4fe1\u533a\u95f4&#xff08;CI&#xff09;<\/span><\/p>\n<h3><span style=\"color:null\">\u793a\u4f8b<\/span><\/h3>\n<p><span style=\"color:null\">\u7ed8\u5236 flights \u6570\u636e\u96c6\u4e2d\u4e58\u5ba2\u6570\u91cf\u968f\u5e74\u4efd\u7684\u53d8\u5316\u8d8b\u52bf&#xff1a;<\/span><\/p>\n<p><span style=\"color:null\">&#xff08;1&#xff09;\u5b50\u56fe1&#xff1a;\u624b\u52a8\u805a\u5408&#xff0c;\u8ba1\u7b97\u5404\u5e74\u4efd\u6240\u6709\u6708\u4efd\u7684\u4e58\u5ba2\u6570\u5747\u503c&#xff0c;\u7ed8\u5236\u6298\u7ebf\u56fe<\/span><\/p>\n<p><span style=\"color:null\">&#xff08;2&#xff09;\u5b50\u56fe2&#xff1a;\u76f4\u63a5\u4f7f\u7528\u539f\u59cb\u6570\u636e\u7ed8\u5236 lineplot&#xff0c;\u7531 Seaborn \u81ea\u52a8\u5bf9\u540c\u4e00 year\u4e0b\u7684\u591a\u4e2a\u89c2\u6d4b\u503c\u8fdb\u884c\u805a\u5408&#xff0c;\u5e76\u663e\u793a\u9ed8\u8ba4\u7684 95% \u7f6e\u4fe1\u533a\u95f4<\/span><\/p>\n<p><span style=\"color:null\">&#xff08;3&#xff09;\u5b50\u56fe3&#xff1a;\u540c\u4e0a&#xff0c;\u4f46\u4f7f\u7528\u00a0errorbar&#061;None \u5173\u95ed\u7f6e\u4fe1\u533a\u95f4<\/span><\/p>\n<p><span style=\"color:null\">&#xff08;4&#xff09;\u5b50\u56fe4&#xff1a;\u4ee5 month \u4e3a\u5206\u7ec4\u53d8\u91cf&#xff08;hue&#061;&#039;month&#039;&#xff09;&#xff0c;\u5728\u540c\u4e00\u5750\u6807\u7cfb\u4e2d\u7ed8\u5236\u591a\u6761\u6298\u7ebf&#xff0c;\u5c55\u793a\u4e0d\u540c\u6708\u4efd\u7684\u5e74\u5ea6\u53d8\u5316\u8d8b\u52bf<\/span><\/p>\n<\/p>\n<p><span style=\"color:null\">flights \u6570\u636e\u96c6\u5f62\u5982&#xff1a;<\/span><\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"115\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260724185856-6a63b5f00d28a.png\" width=\"218\" \/><\/p>\n<p><span style=\"color:null\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><\/p>\n<p><span style=\"color:null\">\u7ed8\u56fe\u7ed3\u679c\u5982\u4e0b&#xff1a;<\/span><\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1949\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260724185856-6a63b5f05dfe9.png\" width=\"2350\" \/><\/p>\n<hr \/>\n<h2><span style=\"color:null\">\u6298\u7ebf\u56fe\u7ec3\u4e60<\/span><\/h2>\n<p><span style=\"color:null\">tips \u6570\u636e\u96c6\u5f62\u5982&#xff1a;<\/span><\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"122\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260724185858-6a63b5f264560.png\" width=\"393\" \/><\/p>\n<p><span style=\"color:null\">\u4f7f\u7528 tips \u6570\u636e\u96c6&#xff0c;\u7ed8\u5236\u6298\u7ebf\u56fe&#xff0c;\u4f53\u73b0\u5348\u9910&#xff08;Lunch&#xff09;\u548c\u665a\u9910&#xff08;Dinner&#xff09;\u7684\u5e73\u5747\u8d26\u5355\u91d1\u989d\u5728\u4e00\u5468\u5185\u7684\u53d8\u5316\u8d8b\u52bf<\/span><\/p>\n<p><span style=\"color:null\">\u8981\u6c42&#xff1a;<\/span><\/p>\n<p><span style=\"color:null\">&#xff08;1&#xff09;x \u8f74&#xff1a;day&#xff08;\u661f\u671f\u51e0&#xff09;\u00a0\u3001y \u8f74&#xff1a;total_bill \u7684\u5e73\u5747\u503c<\/span><\/p>\n<p><span style=\"color:null\">&#xff08;2&#xff09;\u4e2d\u6587\u6807\u9898 &#043; \u4e2d\u6587\u8f74\u6807\u7b7e<\/span><\/p>\n<p><span style=\"color:null\">&#xff08;3&#xff09;\u56fe\u4f8b\u653e\u5728\u56fe\u5916\u53f3\u4fa7<\/span><\/p>\n<p><span style=\"color:null\">&#xff08;4&#xff09;\u5173\u95ed\u7f6e\u4fe1\u533a\u95f4&#xff08;\u56e0\u4e3a\u5929\u6570\u5f88\u5c11&#xff0c;CI \u4e0d\u7a33\u5b9a&#xff09;<\/span><\/p>\n<p><span style=\"color:null\">&#xff08;5&#xff09;\u7528\u6563\u70b9\u56fe\u6807\u51fa\u6298\u7ebf\u8282\u70b9&#xff08;mean \u805a\u5408\u70b9&#xff09;<\/span><\/p>\n<p># \u672c\u4eba\u601d\u8def&#xff0c;\u4ec5\u4f9b\u53c2\u8003<br \/>\nimport seaborn as sns<br \/>\nimport matplotlib.pyplot as plt<br \/>\nimport matplotlib as mpl<\/p>\n<p>df &#061; sns.load_dataset(&#039;tips&#039;)<br \/>\nprint(df.head())<\/p>\n<p>mpl.rcParams[&#039;font.family&#039;] &#061; &#039;SimHei&#039;<br \/>\nmpl.rcParams[&#039;font.size&#039;] &#061; 15<\/p>\n<p>fig, ax &#061; plt.subplots(figsize&#061;(8, 6), dpi&#061;100)<\/p>\n<p>sns.lineplot(<br \/>\n    data&#061;df,<br \/>\n    x&#061;&#039;day&#039;,<br \/>\n    y&#061;&#039;total_bill&#039;,<br \/>\n    hue&#061;&#039;time&#039;,<br \/>\n    errorbar&#061;None,<br \/>\n    ax&#061;ax<br \/>\n)<\/p>\n<p>agg1 &#061; (<br \/>\n    df.groupby([&#039;day&#039;, &#039;time&#039;], observed&#061;True)[&#039;total_bill&#039;]    # observed&#061;True \u4ec5\u4fdd\u7559\u6570\u636e\u4e2d\u5b9e\u9645\u51fa\u73b0\u7684\u7ec4\u5408&#xff1b;observed&#061;False&#xff1a;\u5206\u7ec4\u4e2d\u82e5\u67d0\u9879\u4e0d\u5b58\u5728&#xff0c;\u5219\u663e\u793a NaN<br \/>\n    .mean()<br \/>\n    .reset_index()<br \/>\n)<br \/>\nprint(agg1)<\/p>\n<p>sns.scatterplot(<br \/>\n    data&#061;agg1,<br \/>\n    x&#061;&#039;day&#039;,<br \/>\n    y&#061;&#039;total_bill&#039;,<br \/>\n    hue&#061;&#039;time&#039;,<br \/>\n    legend&#061;False    # \u4e0d\u663e\u793a\u56fe\u4f8b<br \/>\n)<\/p>\n<p>ax.set_xlabel(&#039;\u661f\u671f&#039;)<br \/>\nax.set_ylabel(&#039;\u8ba2\u5355\u603b\u989d\u5e73\u5747\u503c&#039;)<br \/>\nax.set_title(&#039;\u8ba2\u5355\u603b\u989d\u5e73\u5747\u503c\u968f\u661f\u671f\u53d8\u5316\u56fe&#039;)<br \/>\nax.legend(<br \/>\n    title&#061;&#039;\u7528\u9910\u65f6\u6bb5&#039;,<br \/>\n    bbox_to_anchor&#061;(1.02, 1),<br \/>\n    loc&#061;&#039;upper left&#039;<br \/>\n)<\/p>\n<p>plt.tight_layout(rect&#061;(0, 0, 0.82, 1))<br \/>\nplt.show()<\/p>\n<p><span style=\"color:null\">\u7ed8\u56fe\u7ed3\u679c\u5982\u4e0b&#xff1a;<\/span><\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"575\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260724185858-6a63b5f27171f.png\" width=\"626\" \/><\/p>\n<hr \/>\n<h2><span style=\"color:null\">\u7070\u5ea6\u663e\u793a<\/span><\/h2>\n<p><span style=\"color:null\">\u7ed8\u56fe\u65f6\u52a0\u5165\u5982\u4e0b\u53c2\u6570\u8fdb\u884c\u7070\u5ea6\u663e\u793a&#xff1a;<\/span><\/p>\n<p>palette&#061;&#039;gray&#039;,    # \u53bb\u8272<\/p>\n<p><span style=\"color:null\">\u914d\u5408 style \u53ef\u4ee5\u5728\u4e0d\u4f7f\u7528\u989c\u8272\u7684\u60c5\u51b5\u4e0b&#xff0c;\u901a\u8fc7\u6807\u8bb0\u5f62\u72b6&#xff08;\u6563\u70b9\u56fe&#xff09;\u6216\u7ebf\u578b&#xff08;\u6298\u7ebf\u56fe&#xff09;\u533a\u5206\u4e0d\u540c\u7c7b\u522b<\/span><\/p>\n<p><span style=\"color:null\">\u5e38\u7528\u4e8e\u9ed1\u767d\u6253\u5370\u3001\u5b66\u672f\u671f\u520a\u53ca\u7070\u5ea6\u663e\u793a\u573a\u666f<\/span><\/p>\n<hr \/>\n<h2><span style=\"color:null\">\u5173\u7cfb\u56fe sns.relplot<\/span><\/h2>\n<p><span style=\"color:null\">relplot&#xff08;\u5173\u7cfb\u56fe&#xff0c;Relational Plot&#xff09;\u7528\u4e8e\u5728\u56fe\u4e2d\u5c55\u793a\u53d8\u91cf\u4e4b\u95f4\u7684\u5173\u7cfb&#xff0c;\u53ef\u901a\u8fc7 kind \u53c2\u6570\u5207\u6362\u4e3a\u6563\u70b9\u56fe\u6216\u6298\u7ebf\u56fe<\/span><\/p>\n<li><span style=\"color:null\">kind&#061;&#039;scatter&#039; -&gt; scatterplot \u6563\u70b9\u56fe&#xff08;\u9ed8\u8ba4&#xff09;<\/span><\/li>\n<li><span style=\"color:null\">kind&#061;&#039;line&#039; -&gt; lineplot \u6298\u7ebf\u56fe<\/span><\/li>\n<p><span style=\"color:null\">\u57fa\u7840\u53c2\u6570&#xff1a;<\/span><\/p>\n<p>sns.relplot(<br \/>\n    data&#061;df,    # \u6570\u636e<br \/>\n    x&#061;&#039;\u6a2a\u8f74\u53d8\u91cf&#039;,    # \u6a2a\u8f74<br \/>\n    y&#061;&#039;\u7eb5\u8f74\u53d8\u91cf&#039;,    # \u7eb5\u8f74<br \/>\n    hue&#061;&#039;\u989c\u8272\u5206\u7ec4\u7279\u5f81&#039;,    # \u989c\u8272\u533a\u5206<br \/>\n    style&#061;&#039;\u6837\u5f0f\u5206\u7ec4\u7279\u5f81&#039;,    # \u6807\u8bb0 \/ \u7ebf\u578b\u533a\u5206<br \/>\n    size&#061;&#039;\u5927\u5c0f\u6620\u5c04\u7279\u5f81&#039;,    # \u70b9\u5927\u5c0f\u6620\u5c04&#xff08;\u6563\u70b9\u56fe&#xff09;<br \/>\n    markers&#061;True,    # \u662f\u5426\u663e\u793a\u70b9&#xff08;\u6298\u7ebf\u56fe&#xff09;<br \/>\n    dashes&#061;False,    # \u662f\u5426\u4f7f\u7528\u4e0d\u540c\u865a\u7ebf<br \/>\n    kind&#061;&#039;scatter&#039;,    # &#039;scatter&#039; \u6216 &#039;line&#039;<br \/>\n)<\/p>\n<h3><span style=\"color:null\">\u5206\u9762<\/span><\/h3>\n<p>sns.relplot(<br \/>\n    &#039;&#039;&#039;<br \/>\n    \u5176\u4f59\u53c2\u6570<br \/>\n    &#039;&#039;&#039;<br \/>\n    col&#061;&#039;\u6309\u5217\u5206\u9762\u7279\u5f81&#039;,    # \u6309\u5217\u5206\u9762<br \/>\n    col_wrap&#061;&#8230;    # \u4e00\u884c\u6700\u591a\u7684\u5b50\u56fe\u6570\u91cf<br \/>\n    row&#061;&#039;\u6309\u884c\u5206\u9762\u7279\u5f81&#039;,    # \u6309\u884c\u5206\u9762<br \/>\n)<\/p>\n<h4><span style=\"color:null\">1. col, row \u5206\u5217\/\u5206\u884c<\/span><\/h4>\n<p><span style=\"color:null\">\u6307\u5b9a col \u6216\u00a0row \u4e3a\u67d0\u4e00\u7279\u5f81&#xff0c;\u5219\u4f1a\u6309\u8be5\u7279\u5f81\u7684\u6bcf\u4e2a\u53d6\u503c\u751f\u6210\u4e00\u4e2a\u5b50\u56fe&#xff1a;<\/span><\/p>\n<li><span style=\"color:null\">col \u63a7\u5236\u6a2a\u5411\u6392\u5217&#xff08;\u5206\u5217&#xff09;<\/span><\/li>\n<li><span style=\"color:null\">row \u63a7\u5236\u7eb5\u5411\u6392\u5217&#xff08;\u5206\u884c&#xff09;<\/span><\/li>\n<p><span style=\"color:null\">\u9002\u5408\u5728\u591a\u5b50\u56fe\u4e2d\u5bf9\u6bd4\u4e0d\u540c\u7ec4\u522b\u7684\u6570\u636e\u5206\u5e03\u4e0e\u5173\u7cfb<\/span><\/p>\n<h4><span style=\"color:null\">2. col_wrap \u6307\u5b9a\u4e00\u884c\u6700\u591a\u7684\u5b50\u56fe\u6570\u91cf<\/span><\/h4>\n<p><span style=\"color:null\">col_wrap \u6307\u5b9a\u4e00\u884c\u6700\u591a\u7684\u5b50\u56fe\u6570\u91cf&#xff08;\u6700\u5927\u5206\u5217\u6570&#xff09;&#xff0c;\u914d\u5408 col \u4f7f\u7528<\/span><\/p>\n<p>\u5728\u4ec5\u6307\u5b9a col\u3001\u4e0d\u6307\u5b9a row \u7684\u60c5\u51b5\u4e0b\u624d\u53ef\u4f7f\u7528 col_wrap<\/p>\n<h3><span style=\"color:null\">\u793a\u4f8b<\/span><\/h3>\n<p><span style=\"color:null\">tips \u6570\u636e\u96c6\u5f62\u5982&#xff1a;<\/span><\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"122\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260724185858-6a63b5f264560.png\" width=\"393\" \/><\/p>\n<p><span style=\"color:null\">\u4f7f\u7528 tips \u6570\u636e\u96c6&#xff0c;\u7528 relplot \u7ed8\u56fe&#xff1a;<\/span><\/p>\n<p>&#xff08;1&#xff09;<span style=\"color:null\">\u5206\u9762&#xff1a;x \u8f74\u4e3a\u661f\u671f&#xff08;day&#xff09;\u3001y \u8f74\u4e3a\u8d26\u5355\u91d1\u989d&#xff08;total_bill&#xff09; \u7684\u5e73\u5747\u503c&#xff0c;\u6309\u6027\u522b&#xff08;sex&#xff09;\u5206\u5217&#xff0c;\u6309smoker&#xff08;\u662f\u5426\u5438\u70df&#xff09;\u5206\u884c&#xff0c;\u7ed8\u5236\u6298\u7ebf\u56fe&#xff0c;\u5173\u95ed\u7f6e\u4fe1\u533a\u95f4<\/span><\/p>\n<p>import seaborn as sns<br \/>\nimport matplotlib.pyplot as plt<br \/>\nimport matplotlib as mpl<\/p>\n<p>df &#061; sns.load_dataset(&#039;tips&#039;)<br \/>\nprint(df.head())<\/p>\n<p>mpl.rcParams[&#039;font.family&#039;] &#061; &#039;SimHei&#039;<br \/>\nmpl.rcParams[&#039;font.size&#039;] &#061; 15<\/p>\n<p>sns.relplot(<br \/>\n    data&#061;df,<br \/>\n    x&#061;&#039;day&#039;,<br \/>\n    y&#061;&#039;total_bill&#039;,<br \/>\n    kind&#061;&#039;line&#039;,<br \/>\n    hue&#061;&#039;time&#039;,<br \/>\n    col&#061;&#039;sex&#039;,    # \u6309 &#039;sex&#039; \u5206\u5217<br \/>\n    row&#061;&#039;smoker&#039;,    # \u6309 &#039;smoker&#039; \u5206\u884c<br \/>\n    errorbar&#061;None<br \/>\n)<\/p>\n<p>plt.show()<\/p>\n<p>\u7ed8\u56fe\u7ed3\u679c\u5982\u4e0b&#xff1a;<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"975\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260724185858-6a63b5f285393.png\" width=\"1113\" \/><\/p>\n<\/p>\n<p><span style=\"color:null\">&#xff08;2&#xff09;\u5206\u9762&#xff1a;x \u8f74\u4e3a\u8d26\u5355\u91d1\u989d&#xff08;total_bill&#xff09;\u3001y \u8f74\u4e3a\u5c0f\u8d39&#xff08;tips&#xff09;&#xff0c;\u7ed8\u5236\u6563\u70b9\u56fe&#xff0c;\u6839\u636e\u6027\u522b&#xff08;sex&#xff09;\u6620\u5c04\u4e0d\u540c\u989c\u8272&#xff0c;\u6839\u636e\u5c0f\u8d39&#xff08;tips&#xff09;\u7684\u591a\u5c11\u6620\u5c04\u70b9\u7684\u5927\u5c0f&#xff0c;\u6309\u661f\u671f&#xff08;day&#xff09;\u5206\u5217&#xff0c;\u8bbe\u7f6e\u6bcf\u884c\u5b50\u56fe\u6570\u6700\u591a\u4e3a 2<\/span><\/p>\n<\/p>\n<p>import seaborn as sns<br \/>\nimport matplotlib.pyplot as plt<br \/>\nimport matplotlib as mpl<\/p>\n<p>df &#061; sns.load_dataset(&#039;tips&#039;)<br \/>\nprint(df.head())<\/p>\n<p>mpl.rcParams[&#039;font.family&#039;] &#061; &#039;SimHei&#039;<br \/>\nmpl.rcParams[&#039;font.size&#039;] &#061; 15<\/p>\n<p>sns.relplot(<br \/>\n    data&#061;df,<br \/>\n    x&#061;&#039;total_bill&#039;,<br \/>\n    y&#061;&#039;tip&#039;,<br \/>\n    kind&#061;&#039;scatter&#039;,<br \/>\n    hue&#061;&#039;sex&#039;,<br \/>\n    size&#061;&#039;tip&#039;,<br \/>\n    col&#061;&#039;day&#039;,<br \/>\n    col_wrap&#061;2  # \u6bcf\u884c\u6700\u591a\u4e24\u5e45\u5b50\u56fe<br \/>\n)<\/p>\n<p>plt.show()<\/p>\n<p>\u7ed8\u56fe\u7ed3\u679c\u5982\u4e0b&#xff1a;<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"975\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260724185858-6a63b5f2eb930.png\" width=\"1114\" \/><\/p>\n<hr \/>\n<h2><span style=\"color:null\">relplot \u4e0e scatterplot, lineplot \u7684\u5173\u7cfb<\/span><\/h2>\n<p><span style=\"color:null\">\u6b64\u524d\u7684 scatterplot \u4e0e lineplot \u4e3a Axes-level \u7684&#xff0c;\u753b\u5728\u4e00\u4e2a Axes \u4e0a&#xff0c;\u800c relplot \u4e3a Figure-level \u7684&#xff0c;\u753b\u5728\u4e00\u6574\u4e2a Figure \u4e0a&#xff0c;\u8fd4\u56de\u4e00\u4e2a FacetGrid&#xff08;\u5206\u9762\u56fe&#xff09;\u5bf9\u8c61&#xff0c;\u81ea\u52a8 legend\u3001\u81ea\u52a8\u5206\u9762\u3001\u81ea\u52a8\u7ba1\u7406\u5e03\u5c40<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>matplotlib \u753b\u56fe&#xff0c;seaborn \u753b\u53d8\u91cf\u5173\u7cfbseaborn \u672c\u8d28\u4e0a\u662f\u5728 matplotlib \u7684\u753b\u5e03\u4e0a\u753b\u56fe&#xff0c;\u5747\u4f7f\u7528 plt.show() \u6765\u663e\u793a\u7ed8\u5236\u7684\u56fe\u50cf\u5b89\u88c5 Seaborn\u4f7f\u7528 pip \u5b89\u88c5&#xff1a;pip install seaborn\u6ce8\u610f&#xff1a; Seaborn \u4f9d\u8d56 pandas  matplotlib  numpy&#xff0c;\u5b89\u88c5 seaborn \u65f6\u4f1a\u4e00\u5e76\u5b89\u88c5\u8fd9\u4e9b\u4f9d\u8d56\u5728 Python \u4e2d\u5bfc\u5165 Seaborn \u5e93<\/p>\n","protected":false},"author":2,"featured_media":81555,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[2468,81,371,305],"topic":[],"class_list":["post-81568","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-matplotlib","tag-python","tag-371","tag-305"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u3010Seaborn \u5b66\u4e60\u7b14\u8bb0\u3011P1. \u6563\u70b9\u56fe scatterplot\u3001\u6298\u7ebf\u56fe lineplot\u3001\u5173\u7cfb\u56fe relplot - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/81568.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u3010Seaborn \u5b66\u4e60\u7b14\u8bb0\u3011P1. \u6563\u70b9\u56fe scatterplot\u3001\u6298\u7ebf\u56fe lineplot\u3001\u5173\u7cfb\u56fe relplot - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"matplotlib \u753b\u56fe&#xff0c;seaborn \u753b\u53d8\u91cf\u5173\u7cfbseaborn \u672c\u8d28\u4e0a\u662f\u5728 matplotlib \u7684\u753b\u5e03\u4e0a\u753b\u56fe&#xff0c;\u5747\u4f7f\u7528 plt.show() \u6765\u663e\u793a\u7ed8\u5236\u7684\u56fe\u50cf\u5b89\u88c5 Seaborn\u4f7f\u7528 pip \u5b89\u88c5&#xff1a;pip install seaborn\u6ce8\u610f&#xff1a; Seaborn \u4f9d\u8d56 pandas matplotlib numpy&#xff0c;\u5b89\u88c5 seaborn \u65f6\u4f1a\u4e00\u5e76\u5b89\u88c5\u8fd9\u4e9b\u4f9d\u8d56\u5728 Python \u4e2d\u5bfc\u5165 Seaborn \u5e93\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/81568.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-07-24T18:59:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260724185854-6a63b5eeb6295.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/81568.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/81568.html\",\"name\":\"\u3010Seaborn \u5b66\u4e60\u7b14\u8bb0\u3011P1. \u6563\u70b9\u56fe scatterplot\u3001\u6298\u7ebf\u56fe lineplot\u3001\u5173\u7cfb\u56fe relplot - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-07-24T18:59:00+00:00\",\"dateModified\":\"2026-07-24T18:59:00+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/81568.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/81568.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/81568.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u3010Seaborn \u5b66\u4e60\u7b14\u8bb0\u3011P1. \u6563\u70b9\u56fe scatterplot\u3001\u6298\u7ebf\u56fe lineplot\u3001\u5173\u7cfb\u56fe relplot\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u3010Seaborn \u5b66\u4e60\u7b14\u8bb0\u3011P1. \u6563\u70b9\u56fe scatterplot\u3001\u6298\u7ebf\u56fe lineplot\u3001\u5173\u7cfb\u56fe relplot - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/81568.html","og_locale":"zh_CN","og_type":"article","og_title":"\u3010Seaborn \u5b66\u4e60\u7b14\u8bb0\u3011P1. \u6563\u70b9\u56fe scatterplot\u3001\u6298\u7ebf\u56fe lineplot\u3001\u5173\u7cfb\u56fe relplot - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"matplotlib \u753b\u56fe&#xff0c;seaborn \u753b\u53d8\u91cf\u5173\u7cfbseaborn \u672c\u8d28\u4e0a\u662f\u5728 matplotlib \u7684\u753b\u5e03\u4e0a\u753b\u56fe&#xff0c;\u5747\u4f7f\u7528 plt.show() \u6765\u663e\u793a\u7ed8\u5236\u7684\u56fe\u50cf\u5b89\u88c5 Seaborn\u4f7f\u7528 pip \u5b89\u88c5&#xff1a;pip install seaborn\u6ce8\u610f&#xff1a; Seaborn \u4f9d\u8d56 pandas matplotlib numpy&#xff0c;\u5b89\u88c5 seaborn \u65f6\u4f1a\u4e00\u5e76\u5b89\u88c5\u8fd9\u4e9b\u4f9d\u8d56\u5728 Python \u4e2d\u5bfc\u5165 Seaborn \u5e93","og_url":"https:\/\/www.wsisp.com\/helps\/81568.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-07-24T18:59:00+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260724185854-6a63b5eeb6295.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"6 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/81568.html","url":"https:\/\/www.wsisp.com\/helps\/81568.html","name":"\u3010Seaborn \u5b66\u4e60\u7b14\u8bb0\u3011P1. \u6563\u70b9\u56fe scatterplot\u3001\u6298\u7ebf\u56fe lineplot\u3001\u5173\u7cfb\u56fe relplot - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-07-24T18:59:00+00:00","dateModified":"2026-07-24T18:59:00+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/81568.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/81568.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/81568.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u3010Seaborn \u5b66\u4e60\u7b14\u8bb0\u3011P1. \u6563\u70b9\u56fe scatterplot\u3001\u6298\u7ebf\u56fe lineplot\u3001\u5173\u7cfb\u56fe relplot"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/81568","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=81568"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/81568\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/81555"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=81568"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=81568"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=81568"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=81568"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}