I was searching for how to plot a scatter plot with points that have a transparent face but coloured edges. This page gave some ideas, but I find the behaviour of some arguments to differ than reported there. For example, one answer describes argument c
as affecting both face color and edge color, causing arguments for the latter two to be ignored. In contrast I found the following to be synonymous: c
, color
, facecolor
, facecolors
.
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
xy = np.random.randint(10,size=[2,10])
colors = sns.color_palette('deep',10)
plt.rcParams['figure.dpi']=100
# These have the same effect (solid faces)
plt.clf(); plt.scatter( *xy, s=10000, c=colors )
plt.clf(); plt.scatter( *xy, s=10000, color=colors )
plt.clf(); plt.scatter( *xy, s=10000, facecolor=colors )
plt.clf(); plt.scatter( *xy, s=10000, facecolors=colors )
# These have the same effect (transparent faces, solid edges)
plt.clf(); plt.scatter( *xy, s=10000, edgecolors=colors, c='None' )
plt.clf(); plt.scatter( *xy, s=10000, edgecolors=colors, color='None' )
plt.clf(); plt.scatter( *xy, s=10000, edgecolors=colors, facecolor='None' )
plt.clf(); plt.scatter( *xy, s=10000, edgecolors=colors, facecolors='None' )
I also found that all 4 arguments are mentioned in the documentation but only c
is listed as a pyplot.scatter()
argument. Hence, the others don’t get a detailed description.
I thought that the documentation is definitive and covers all possible arguments. Why do the other arguments not appear in the documentation? I think that’s part of the reason why there is confusion about the arguments and when some arguments override others.