# Update on Documentation #631

Closed
opened this Issue Dec 19, 2011 · 4 comments

None yet

### 3 participants

commented Dec 19, 2011
 in the table for marker vertices it states http://matplotlib.sourceforge.net/api/artist_api.html#matplotlib.lines.Line2D.set_marker 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 plot(x,c='r',marker=((-1.,-1),(1.,-1),(1.,1.),(-1,1.),(-1,-1)),ms=10)``` 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))) plot(x,c='r',marker=p,ms=10)``` or a cool example that you may want tot add to the library... ```import matplotlib.path as path # define codes P = path.Path Pm = P.MOVETO Pl = P.LINETO Pc = P.CLOSEPOLY 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 plot(x,c='r',marker=p,ms=10)``` 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!!!
Contributor
commented Dec 19, 2011
 PS - I guess I need to figure out how to do such updates w/o requesting Take a look at http://help.github.com/fork-a-repo/ 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: https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/markers.py (That you can even directly fork/edit in github, but for huge change, it might be better to clone.)
commented Dec 19, 2011
 Where/how do I add examples - example plots for the library -, as the one given above? 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?
Contributor
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 ``` example: ```import things def MyFunc(): things.doStuff()``` See `Github Flavored Markdown` on top right of response area where you write
referenced this issue Apr 16, 2012
Merged

#### Extended marker documentation #834

Member
commented Jun 5, 2012
 #834 Implemented these suggestions (with a pretty gallery picture too).
closed this Jun 5, 2012