第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

如何更改seaborn散點(diǎn)圖中的專色邊緣顏色?

如何更改seaborn散點(diǎn)圖中的專色邊緣顏色?

ibeautiful 2021-07-19 16:13:05
我使用 seaborn 創(chuàng)建了一個(gè)散點(diǎn)圖:import seaborn as snssns.set(style="ticks", color_codes=True)        g=sns.scatterplot(x="length", y="coverage", data=df, hue = 'Products', edgecolors=None, alpha = 0.7)g.set(yscale="log")plt.xlabel("Length(bp)")plt.ylabel("Coverage")plt.legend(loc = 'lower right')plt.savefig('ATN_plot.png',dpi = 600)原始數(shù)據(jù)(部分):contig  length  coverage    pathway Products53  1230    2423    stigmatellin    Yes58  1195    885 curacin Yes65  1161    598 jamaicamide Yes68  1159    8001    jamaicamide Yes79  1113    1423    curacin Yes105 1042    1106    stigmatellin    Yes727 666 223 HSAF (heat stable antifungal factor)    Yes787 655 37  curacin Yes791 654 13  stigmatellin    Yes798 652 49  stigmatellin    Yes844 642 5774    jamaicamide Yes89  1090    13  No  No90  1089    10  No  No91  1086    26  No  No92  1080    16  No  No93  1079    10  No  No94  1079    13  No  No最后的情節(jié)是這樣的:我不喜歡斑點(diǎn)的白色邊緣。圖像的左下部分聚集了最多的斑點(diǎn),看起來太白了。我已經(jīng)包含edgecolors=None在我的代碼中,但它似乎不起作用。有誰(shuí)知道如何去除邊緣顏色或?qū)⑵涓臑槠渌伾?
查看完整描述

3 回答

?
猛跑小豬

TA貢獻(xiàn)1858條經(jīng)驗(yàn) 獲得超8個(gè)贊

替換edgecolors=Nonelinewidth=0

就像是:

g=sns.scatterplot(x="length", y="coverage", data=df, hue = 'Products', 
                  linewidth=0, alpha = 0.7)


查看完整回答
反對(duì) 回復(fù) 2021-07-28
?
大話西游666

TA貢獻(xiàn)1817條經(jīng)驗(yàn) 獲得超14個(gè)贊

在 matplotlib 中,大多數(shù)參數(shù)都采用None“使用默認(rèn)值”。而在這里您不想使用默認(rèn)值,而是不想使用邊緣顏色。這是通過"none".

sns.scatterplot(..., edgecolor="none")


查看完整回答
反對(duì) 回復(fù) 2021-07-28
?
蝴蝶刀刀

TA貢獻(xiàn)1801條經(jīng)驗(yàn) 獲得超8個(gè)贊

您可以通過傳遞 kwargs(關(guān)鍵字參數(shù))來更改專色


kwargs  =   {'edgecolor':"r", # for edge color

             'linewidth':2.7, # line width of spot

             'linestyle':'--', # line style of spot

            }

sns.scatterplot(x = "tip", y = "total_bill", data = tips_df, hue = "sex", 

                size ="sex", sizes = (100, 300), palette = "nipy_spectral" ,**kwargs)

或者您可以直接將其作為參數(shù)傳遞,例如:


sns.scatterplot(x = "tip", y = "total_bill", data = tips_df, hue = "sex", 

                size ="sex", sizes = (100, 300), palette = "nipy_spectral",

                edgecolor='r',

                linewidth=2,

                linestyle='--',)

輸出 >>>

http://img1.sycdn.imooc.com//610109dc0001fd9209430534.jpg

我希望,我已經(jīng)解開了你的疑惑。


查看完整回答
反對(duì) 回復(fù) 2021-07-28
  • 3 回答
  • 0 關(guān)注
  • 853 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)