You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MarkerStyle Instance not Accepted for scatter #3895
The docstring for scatter says that the marker keyword argument will accept a matplotlib.markers.MarkerStyle instance. However, when I pass one in, it breaks when trying to initialize a new MarkerStyle instance using an existing one. We could easily replace https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/axes/_axes.py#L3647 with the following to fix it:
Hello, the patch mentioned by rosenbrockc did solve the failure of my test code:
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.markers as mks
plt.close('all')
N = 50
x = np.random.rand(N)
y = np.random.rand(N)
colors = np.random.rand(N)
area = np.pi * (15 * np.random.rand(N))**2 # 0 to 15 point radiuses
mymkstyle = mks.MarkerStyle(marker=u'o', fillstyle=u'full')
plt.scatter(x, y,color = 'k',s = 100, marker = mymkstyle )
plt.show()
But if I change the fillstyle to u'none', I still get all the circle filled with black colors, not a black ring. Fillstyle works OK with u'left', u'right', u'bottom', u'top' and u'full'.
Activity
tacaswell commentedon Dec 7, 2014
Can you put in a pull request with that change (plus a test)?
tacaswell commentedon Dec 7, 2014
Can you also update the docs on scatter to mention that marker takes strings?
asmwarrior commentedon Dec 17, 2014
Hello, the patch mentioned by rosenbrockc did solve the failure of my test code:
But if I change the fillstyle to
u'none', I still get all the circle filled with black colors, not a black ring. Fillstyle works OK withu'left',u'right',u'bottom',u'top'andu'full'.PS: I was asked this question in Stackoverflow: matplotlib, why custom marker style is not allowed in scatter functions, and someone pointed me here.
scatter: fix marker kwarg bug. Closes matplotlib#4073, matplotlib#3895.
scatter: fix marker kwarg bug. Closes matplotlib#4073, matplotlib#3895.
scatter: fix marker kwarg bug. Closes matplotlib#4073, matplotlib#3895.
tacaswell commentedon Feb 19, 2015
Closed by 86e5e65