Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't set marker fillstyle #4073

Closed
ibell opened this issue Feb 6, 2015 · 2 comments
Closed

Can't set marker fillstyle #4073

ibell opened this issue Feb 6, 2015 · 2 comments
Assignees
Milestone

Comments

@ibell
Copy link

ibell commented Feb 6, 2015

On windows, I can't seem to set the marker using a MarkerStyle instance (should this be possible?). If I am doing this wrong, how DO I set the fillstyle?

import matplotlib.pyplot as plt
from matplotlib.markers import MarkerStyle
plt.scatter([1,2,3], [1,4,9], marker = MarkerStyle('o', fillstyle = 'top'))
plt.show()

yields

Traceback (most recent call last):
  File "markers.py", line 4, in <module>
    plt.scatter([1,2,3], [1,4,9], marker = MarkerStyle('o', fillstyle = 'top'))
  File "C:\Users\ihb\AppData\Local\Continuum\Miniconda\lib\site-packages\matplotlib\pyplot.py", line 3200, in scatter
    linewidths=linewidths, verts=verts, **kwargs)
  File "C:\Users\ihb\AppData\Local\Continuum\Miniconda\lib\site-packages\matplotlib\axes\_axes.py", line 3632, in scatter
    marker_obj = mmarkers.MarkerStyle(marker)
  File "C:\Users\ihb\AppData\Local\Continuum\Miniconda\lib\site-packages\matplotlib\markers.py", line 169, in __init__
    self.set_marker(marker)
  File "C:\Users\ihb\AppData\Local\Continuum\Miniconda\lib\site-packages\matplotlib\markers.py", line 244, in set_marker
    Path(marker)
  File "C:\Users\ihb\AppData\Local\Continuum\Miniconda\lib\site-packages\matplotlib\path.py", line 137, in __init__
    vertices = np.asarray(vertices, np.float_)
  File "C:\Users\ihb\AppData\Local\Continuum\Miniconda\lib\site-packages\numpy\core\numeric.py", line 462, in asarray
    return array(a, dtype, copy=False, order=order)
TypeError: float() argument must be a string or a number

Me:

C:\Users\ihb>ipython
Python 2.7.8 |Continuum Analytics, Inc.| (default, Jul  2 2014, 15:12:11) [MSC v.1500 64 bit (AMD64)]
Type "copyright", "credits" or "license" for more information.

IPython 2.3.1 -- An enhanced Interactive Python.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://binstar.org
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: import matplotlib

In [2]: matplotlib.__version__
Out[2]: '1.4.2'
@tacaswell tacaswell added this to the v1.5.x milestone Feb 7, 2015
@tacaswell
Copy link
Member

I think this has come up before #3895 but not yet fixed. The issue seems to be that scatter does not check that marker input is makerstyle objects and then does a bunch of internal magic to extract the path that is then passed to the underlying PathCollection.

@efiring efiring self-assigned this Feb 8, 2015
efiring added a commit to efiring/matplotlib that referenced this issue Feb 8, 2015
I also tried to clean up some of the scatter code and documentation,
together with related documentation in collections.  I added a test.
efiring added a commit to efiring/matplotlib that referenced this issue Feb 8, 2015
I also tried to clean up some of the scatter code and documentation,
together with related documentation in collections.  I added a test.
@ibell
Copy link
Author

ibell commented Feb 19, 2015

Thanks!

On Wed, Feb 18, 2015 at 8:48 PM, Eric Firing notifications@github.com
wrote:

Closed #4073 #4073 via
18cc8bf
18cc8bf
.


Reply to this email directly or view it on GitHub
#4073 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants