Reputation: 1375
matplotlib.pyplot.scatter
has a facecolors=None
argument that will give data point markers the appearance of being hollow on the inside. How can I get the same look for pandas.DataFrame.plot.scatter()
?
Upvotes: 5
Views: 5832
Reputation: 62513
matplotlib
documentation, but it seems fc
and ec
are aliases for facecolor
and edgecolor
, respectively.
pandas
plot engine is matplotlib
.fc
. To use fc
, you should also use ec
.
fc='none'
, without specifying ec
, will result in blank markers.'None'
and 'none'
both work, but not None
.import seaborn as sns # for data
import matplotlib.pyplot as plt
# load data
penguins = sns.load_dataset("penguins", cache=False)
# set x and y
x, y = penguins["bill_length_mm"], penguins["bill_depth_mm"]
# plot
plt.scatter(x, y, fc='none', ec='g')
# penguins is a pandas dataframe
penguins[['bill_length_mm', 'bill_depth_mm']].plot.scatter('bill_depth_mm', 'bill_length_mm', ec='g', fc='none')
Upvotes: 4
Reputation: 150785
It's option c
(note that it's 'None'
not None
, even for facecolors
in plt
):
df.plot.scatter(x='x',y='y', c='None', edgecolors='C1')
Output:
Upvotes: 6