forked from matplotlib/matplotlib
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix docstrings about refactored markers.
- Loading branch information
Showing
3 changed files
with
48 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,9 +4,12 @@ | |
`~matplotlib.axes.Axes.scatter`. | ||
""" | ||
|
||
import textwrap | ||
|
||
import numpy as np | ||
|
||
from cbook import is_math_text, is_string_like, is_numlike, iterable | ||
import docstring | ||
from matplotlib import rcParams | ||
from path import Path | ||
from transforms import IdentityTransform, Affine2D | ||
|
@@ -17,20 +20,43 @@ | |
|
||
class MarkerStyle: | ||
style_table = """ | ||
======================== ===================================================== | ||
marker description | ||
======================== ===================================================== | ||
============================== =============================================== | ||
marker description | ||
============================== =============================================== | ||
%s | ||
``'$...$'`` render the string using mathtext | ||
(numsides, style, angle) see below | ||
verts where verts is a list of (x, y) pairs in range (0, 1) | ||
======================== ===================================================== | ||
TODO: Describe tuple form | ||
``'$...$'`` render the string using mathtext | ||
*verts* a list of (x, y) pairs in range (0, 1) | ||
(*numsides*, *style*, *angle*) see below | ||
============================== =============================================== | ||
The marker can also be a tuple (*numsides*, *style*, *angle*), which | ||
will create a custom, regular symbol. | ||
*numsides*: | ||
the number of sides | ||
*style*: | ||
the style of the regular symbol: | ||
===== ============================================= | ||
Value Description | ||
===== ============================================= | ||
0 a regular polygon | ||
1 a star-like symbol | ||
2 an asterisk | ||
3 a circle (*numsides* and *angle* is ignored) | ||
===== ============================================= | ||
*angle*: | ||
the angle of rotation of the symbol | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
pelson
|
||
For backward compatibility, the form (*verts*, 0) is also accepted, | ||
but it is equivalent to just *verts* for giving a raw set of vertices | ||
that define the shape. | ||
""" | ||
|
||
# TODO: Automatically generate this | ||
accepts = """ACCEPTS: [ %s | ``'$...$'`` | tuple ]""" | ||
accepts = """ACCEPTS: [ %s | ``'$...$'`` | *tuple* | *Nx2 array* ]""" | ||
|
||
markers = { | ||
'.' : 'point', | ||
|
@@ -603,11 +629,14 @@ def _set_x(self): | |
self._path = self._x_path | ||
|
||
_styles = [(repr(x), y) for x, y in MarkerStyle.markers.items()] | ||
_styles.sort() | ||
_styles.sort(lambda x, y: cmp(x[1], y[1])) | ||
MarkerStyle.style_table = ( | ||
MarkerStyle.style_table % | ||
'\n'.join(['``%7s`` %33s' % (x, y) for (x, y) in _styles])) | ||
'\n'.join(['%-30s %-33s' % ('``%s``' % x, y) for (x, y) in _styles])) | ||
|
||
MarkerStyle.accepts = ( | ||
MarkerStyle.accepts = textwrap.fill( | ||
MarkerStyle.accepts % | ||
' | '.join(['``%s``' % x for (x, y) in _styles])) | ||
|
||
docstring.interpd.update(MarkerTable=MarkerStyle.style_table) | ||
docstring.interpd.update(MarkerAccepts=MarkerStyle.accepts) |
The change to degrees was not intentional. @jdh2358, @efiring: What do you guys think? Do you think the angle of the scatter marker should stay in radians (as it always was)?