Search code examples
pythonseaborn

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): enter image description here

Thanks!


Solution

  • 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'])