question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is the `markers` parameter in scatterplot() not implemented?

See original GitHub issue

Hello! I’m trying to create a scatter plot where the markers are different for each category (both the colour and the marker style). I can do this in lmplot(), for example:

iris = sns.load_dataset('iris')
sns.lmplot(data=iris, x='petal_length', y='petal_width', hue='species', markers=['o', '*', '+'], fit_reg=False)

image

But when I try the equivalent with the scatterplot() function, the markers are all the same style:

sns.scatterplot(data=iris, x='petal_length', y='petal_width', hue='species', markers=['o', '*', '+'])

image

I’m wondering if this markers parameter hasn’t been implemented yet in scatterplot(), or if it requires a different syntax? I’ve tried various different approaches, but I can’t seem to get the markers to be different styles for different categories.

Alternatively, is there some way that I can use lmplot() so that the scatter plot it creates can be created as a subplot within a figure with other subplots, that aren’t part of a FacetGrid? This is straightforward with scatterplot() because I can provide the subplot axes as an input to the function, but I can’t figure out how to do this with lmplot().

Any assistance would be greatly appreciated! Thank you!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:14 (8 by maintainers)

github_iconTop GitHub Comments

19reactions
mwaskomcommented, Nov 4, 2018

You can’t mix filled and line markers, just like the error message says.

13reactions
jenflycommented, Nov 5, 2018

Yes, I did read the error message. I was hoping to gain some insight on the inconsistent behaviour between lmplot() and scatterplot(), since lmplot() allows filled and line markers to be mixed, whereas scatterplot() apparently does not. It would have been nice if I could make the same scatter plot with either function, but no big deal. Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Size parameter in Plotly R scatter plot with data and value ...
Size parameter in Plotly R scatter plot with data and value does not work · 2. try this plot_ly(df, x = date, y...
Read more >
Scatter plot - MATLAB scatter - MathWorks
This MATLAB function creates a scatter plot with circular markers at the locations specified by the vectors x and y.
Read more >
SCATTERPLOT Statement - SAS Help Center
MARKERATTRS=style-element | style-element (marker-options) | (marker-options) specifies the attributes of the data markers.
Read more >
Scatter Plot in Matplotlib - Scaler Topics
Scatter() function takes many parameters, including marker size, the color of the dots, blending value, and linewidth. We can use different ...
Read more >
How to Annotate Matplotlib Scatter Plots? - GeeksforGeeks
Here, we will use matplotlib.pyplot.scatter() method to plot. ... the necessary parameters to create a scatter plot; marker : MarkerStyle, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found