Custom symbols

would be nice. Or, if I write something like this myself,

    > is there any chance to add this to matplotlib ?

certainly.

John Hunter wrote:

    > would be nice. Or, if I write something like this myself,
    > is there any chance to add this to matplotlib ?

certainly.

I personally find it a little bit confusing to have the option to define
a marker-symbol via two different keywords: marker and verts. Isn't it
possible and more natural to use the same keyword (maker) for multiple
options?

Hm , how about the following ideas:

- remove keyword verts again
- check type of argument of marker
  -> string: behave as before
  -> a list or a tuple that may be
       (numsides, style, [optional angle])
     or
       (verts, style, [optional angle])

- then it would be possible to define a custom symbol giving the number
of sides it should have + a style (i.e, filled or starred)
  AND
- to define a custom symbol using a list of (x,y) points

I have fiddled a little bit around with matplotlib/axes.py and attach a
file that contains a modified version of the function scatter() in
axes.py, as well as a little script and it's output.

What is missing - and I haven't tried that - is to add a class similar
to RegularPolyCollection for Lines allowing for none-filled symbols.
This should/could produce star-like symbols. Adding the option style for
verts would also allow e.g. S-shaped line-symbols (-> Create a
LineCollection instead of a PolyCollection).

As you can see in the modified scatter function, I also added a
rescaling for 'verts'. This rescaling assumes that the vertices are
centred on the coordinate origin (or if not, one has the option to
systematically displace symbols !), and rescales them such that the
largest distance from the origin is 1.

I hope this is somehow helpful ...!?

Manuel

axes.py_scatterfunction.txt (8.32 KB)

modified_scatter_example.py (296 Bytes)

customsymbol.png