Update on Documentation #631

2sn opened this Issue Dec 19, 2011 · 4 comments


None yet

3 participants

2sn commented Dec 19, 2011
  1. in the table for marker vertices it states


verts a list of (x, y) pairs in range (0, 1)

it really should be just normalized or abs(1), (0,0) being center, and
hence the (x,y) values should be in the range (-1,+1). Would be good to
add an example

x = np.linspace(0,1,10)**2
  1. the source also support to just provide a path as a marker, which (a)
    is cool, and (b) seemed natural as internal many things are done a
    paths, and even complies paths are generated from the $...$ syntax math.
    In any case, this should be added to the documentation for allowed markers

path a matplotlib.path.Path object

import matplotlib.path as path
x = np.linspace(0,1,10)**2
p = path.Path(((-1.,-1),(1.,-1),(1.,1.),(-1,1.),(-1,-1)))

or a cool example that you may want tot add to the library...

import matplotlib.path as path

# define codes
P = path.Path
c = [Pm] + [Pl]*3 + [Pc]
cx = c*2

# define basic path
r = np.array(((-1.,-1),(1.,-1),(1.,1.),(-1,1.),(-1,-1)))
# we add second closed path of half size but reverse parity
rh = 0.5*r[::-1]
rx = np.vstack((r,rh))
p = path.Path(rx,codes=cx)

x = np.linspace(0,1,10)**2

PS - I guess I need to figure out how to do such updates w/o requesting
action from the list eventually.

Just to emphasize (2a): COOL!!!

Carreau commented Dec 19, 2011

PS - I guess I need to figure out how to do such updates w/o requesting

Take a look at
The 'Pull Request' section explain how to propose a code change. Any other readable git-repository with the change might also work but without github 'magic'

Most of the time, Sphinx build the doc directly from the docstring of function/classes/modules, so look for the given object and update it. In this case of the doc.

I think it will be this file for your example:
(That you can even directly fork/edit in github, but for huge change, it might be better to clone.)

2sn commented Dec 19, 2011
  1. Where/how do I add examples - example plots for the library -, as the one given above?
  2. if I have different but related changes (I also submitted one big fix to markers.py and one update/correction to that same file) should I put them in independent pull requests if they can be dealt with independently?
Carreau commented Dec 19, 2011

If closely related, I would do in same PR (means pull request, it took me some time to understand it)
If it makes sens to propose a change, even in the same file, but separately : different PRs. It allows to merge/close one without impacting the other.

the example you gave (http://matplotlib.sourceforge.net/api/artist_api.html#matplotlib.lines.Line2D.set_marker)
is defined in this file :
/lib/matplotlib/markers.py in matplotlib directory.
If you update the docstring in this file, then when the documentation will be rebuilt, the change will be reflected in the html documentation.

I'm not an expert in how the documentation is built, to give you the exact detail on how it works. But if it is marker's specific example, I think that should go in here.

Note that one of your example is equivalent to using 's' as marker

BTW, to write code, you can

  • blankline
  • use triple backquote ```
  • code
  • triple backquote ```


import things

def MyFunc():

See Github Flavored Markdown on top right of response area where you write

pelson commented Jun 5, 2012

#834 Implemented these suggestions (with a pretty gallery picture too).

@pelson pelson closed this Jun 5, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment