简体   繁体   中英

Setting markers colour on seaborn

everybody,

I am trying to do an lmplot but I want for the markers to differ between them only in format, not colour. I want them all to be black. I also tried to use a grey-scale palette such as 'Greys' or 'binary', but then some markers get very light, if there is a way of making them more apparent I'd also take it! I am using lmplot with fit_reg=False just because I'd like to use hue and as far as I know scatter does not have that function. The code I am using is:

sns.set_style("whitegrid")
sns.lmplot(data=data,x='Day',y='Temperature',hue='Site',fit_reg=False,markers=['o','+','x','s','p']).fig.set_size_inches(15,5)

And this is the resulting figure (ignore the black background): 在此处输入图片说明

Thanks!

The color is determined through the palette keyword. You may use a "palette" of only one color.

sns.lmplot(data=data,x='Day', y='Temperature', hue='Site', 
           palette=["black"], markers=['o','+','x','s','p'])

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM