0

I created a scatter plot of some data from a grouped Pandas Dataframe (see code below). I can't figure out how to set the marker type to an open/unfilled circle. None of the parameters I have found in other posts work (ms, markeredgewidth, markerfacecolor, facecolor, edgewidth - all listed as "unknown properties"). Is there a parameter I am missing? I am using matplotlib and seaborn.

for key, group in grouped_by_model:
    group.plot(ax=ax, kind='scatter', x='CURR MILEAGE', y='REPAIR TOTAL', color=colors[key], marker = 'o', s=20)
Mtd240
  • 115
  • 1
  • 1
  • 7
  • Unfortunately, [this question](https://stackoverflow.com/questions/45250916/matplotlib-scatter-edge-without-specifying-edgecolor) does not have any upvotes on its answer, so we cannot close this as duplicate. – ImportanceOfBeingErnest Jul 24 '17 at 14:00

1 Answers1

3

As seen in this question's answer, you may use a hollow marker

marker=ur"$\u25EF$"

to plot the scatter.

for key, group in grouped_by_model:
    group.plot(ax=ax, kind='scatter', x='CURR MILEAGE', y='REPAIR TOTAL', 
                      color=colors[key], marker = ur"$\u25EF$", s=20) 
ImportanceOfBeingErnest
  • 321,279
  • 53
  • 665
  • 712
  • Thanks for the quick response. This doesn't seem to work though - gave me a SyntaxError - is there a package I need to import? – Mtd240 Jul 24 '17 at 14:10
  • No, but without the actual error and the code that produces the error, it's not possible to help. This is also the reason you should always create [mcve]s. – ImportanceOfBeingErnest Jul 24 '17 at 14:11
  • 1
    Thanks, apologies for the lack of helpful sample code. I figured it out - I had to remove the "ur" like so `marker = "$\u25ef$"` – Mtd240 Jul 24 '17 at 14:15
  • 1
    That's interesting. For me it only works if the string is a unicode raw string, i.e. with `ur` in front of it. – ImportanceOfBeingErnest Jul 24 '17 at 15:03