Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0aee813

Browse files
committed
artist docstring conversion
svn path=/trunk/matplotlib/; revision=5649
1 parent a8d35d4 commit 0aee813

2 files changed

Lines changed: 54 additions & 51 deletions

File tree

doc/devel/outline.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ projections/__init__ needs conversion
112112
projections/geo needs conversion
113113
projections/polar needs conversion
114114
afm converted
115-
artist needs conversion
115+
artist converted
116116
axes needs conversion
117117
axis needs conversion
118118
backend_bases needs conversion

lib/matplotlib/artist.py

Lines changed: 53 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,15 @@ def remove(self):
8181
# TODO: add legend support
8282

8383
def have_units(self):
84-
'return True if units are set on the x or y axes'
84+
'return *True* if units are set on the x or y axes'
8585
ax = self.axes
8686
if ax is None or ax.xaxis is None:
8787
return False
8888
return ax.xaxis.have_units() or ax.yaxis.have_units()
8989

9090
def convert_xunits(self, x):
9191
"""for artists in an axes, if the xaxis as units support,
92-
convert x using xaxis unit type
92+
convert *x* using xaxis unit type
9393
"""
9494
ax = getattr(self, 'axes', None)
9595
if ax is None or ax.xaxis is None:
@@ -99,22 +99,22 @@ def convert_xunits(self, x):
9999

100100
def convert_yunits(self, y):
101101
"""for artists in an axes, if the yaxis as units support,
102-
convert y using yaxis unit type
102+
convert *y* using yaxis unit type
103103
"""
104104
ax = getattr(self, 'axes', None)
105105
if ax is None or ax.yaxis is None: return y
106106
return ax.yaxis.convert_units(y)
107107

108108
def set_axes(self, axes):
109109
"""
110-
set the axes instance the artist resides in, if any
110+
set the axes instance in which the artist resides, if any
111111
112112
ACCEPTS: an axes instance
113113
"""
114114
self.axes = axes
115115

116116
def get_axes(self):
117-
'return the axes instance the artist resides in, or None'
117+
'return the axes instance the artist resides in, or *None*'
118118
return self.axes
119119

120120
def add_callback(self, func):
@@ -170,7 +170,7 @@ def hitlist(self,event):
170170
for a in self.get_children(): L.extend(a.hitlist(event))
171171
return L
172172

173-
def contains(self,mouseevent):
173+
def contains(self, mouseevent):
174174
"""Test whether the artist contains the mouse event.
175175
176176
Returns the truth value and a dictionary of artist specific details of
@@ -189,26 +189,28 @@ def set_contains(self,picker):
189189
190190
hit, props = picker(artist, mouseevent)
191191
192-
If the mouse event is over the artist, return hit=True and props
192+
If the mouse event is over the artist, return *hit=True* and *props*
193193
is a dictionary of properties you want returned with the contains test.
194194
"""
195195
self._contains = picker
196196

197197
def get_contains(self):
198-
'return the _contains test used by the artist, or None for default.'
198+
'return the _contains test used by the artist, or *None* for default.'
199199
return self._contains
200200

201201
def pickable(self):
202-
'return True if self is pickable'
202+
'return *True* if self is pickable'
203203
return (self.figure is not None and
204204
self.figure.canvas is not None and
205205
self._picker is not None)
206206

207207
def pick(self, mouseevent):
208208
"""
209-
pick(mouseevent)
209+
call signature::
210210
211-
each child artist will fire a pick event if mouseevent is over
211+
pick(mouseevent)
212+
213+
each child artist will fire a pick event if *mouseevent* is over
212214
the artist and the artist has picker set
213215
"""
214216
# Pick self
@@ -229,31 +231,31 @@ def set_picker(self, picker):
229231
"""
230232
set the epsilon for picking used by this artist
231233
232-
picker can be one of the following:
234+
*picker* can be one of the following:
233235
234-
None - picking is disabled for this artist (default)
236+
* *None*: picking is disabled for this artist (default)
235237
236-
boolean - if True then picking will be enabled and the
237-
artist will fire a pick event if the mouse event is over
238-
the artist
238+
* A boolean: if *True* then picking will be enabled and the
239+
artist will fire a pick event if the mouse event is over
240+
the artist
239241
240-
float - if picker is a number it is interpreted as an
241-
epsilon tolerance in points and the the artist will fire
242-
off an event if it's data is within epsilon of the mouse
243-
event. For some artists like lines and patch collections,
244-
the artist may provide additional data to the pick event
245-
that is generated, eg the indices of the data within
246-
epsilon of the pick event
242+
* A float: if picker is a number it is interpreted as an
243+
epsilon tolerance in points and the artist will fire
244+
off an event if it's data is within epsilon of the mouse
245+
event. For some artists like lines and patch collections,
246+
the artist may provide additional data to the pick event
247+
that is generated, e.g. the indices of the data within
248+
epsilon of the pick event
247249
248-
function - if picker is callable, it is a user supplied
249-
function which determines whether the artist is hit by the
250-
mouse event::
250+
* A function: if picker is callable, it is a user supplied
251+
function which determines whether the artist is hit by the
252+
mouse event::
251253
252254
hit, props = picker(artist, mouseevent)
253255
254-
to determine the hit test. if the mouse event is over the
255-
artist, return hit=True and props is a dictionary of
256-
properties you want added to the PickEvent attributes.
256+
to determine the hit test. if the mouse event is over the
257+
artist, return *hit=True* and props is a dictionary of
258+
properties you want added to the PickEvent attributes.
257259
258260
ACCEPTS: [None|float|boolean|callable]
259261
"""
@@ -263,7 +265,6 @@ def get_picker(self):
263265
'return the Pickeration instance used by this artist'
264266
return self._picker
265267

266-
267268
def is_figure_set(self):
268269
return self.figure is not None
269270

@@ -279,7 +280,7 @@ def set_figure(self, fig):
279280
Set the :class:`~matplotlib.figure.Figure` instance the artist
280281
belongs to.
281282
282-
ACCEPTS: a matplotlib.figure.Figure instance
283+
ACCEPTS: a :class:`matplotlib.figure.Figure` instance
283284
"""
284285
self.figure = fig
285286
self.pchanged()
@@ -288,7 +289,7 @@ def set_clip_box(self, clipbox):
288289
"""
289290
Set the artist's clip Bbox
290291
291-
ACCEPTS: a matplotlib.transform.Bbox instance
292+
ACCEPTS: a :class:`matplotlib.transform.Bbox` instance
292293
"""
293294
self.clipbox = clipbox
294295
self._clipon = clipbox is not None or self._clippath is not None
@@ -298,21 +299,22 @@ def set_clip_path(self, path, transform=None):
298299
"""
299300
Set the artist's clip path, which may be:
300301
301-
a) a :class:`~matplotlib.patches.Patch` (or subclass) instance
302+
* a :class:`~matplotlib.patches.Patch` (or subclass) instance
302303
303-
b) a :class:`~matplotlib.path.Path` instance, in which case
304+
* a :class:`~matplotlib.path.Path` instance, in which case
304305
an optional :class:`~matplotlib.transforms.Transform`
305306
instance may be provided, which will be applied to the
306307
path before using it for clipping.
307308
308-
c) *None*, to remove the clipping path
309+
* *None*, to remove the clipping path
309310
310311
For efficiency, if the path happens to be an axis-aligned
311312
rectangle, this method will set the clipping box to the
312313
corresponding rectangle and set the clipping path to *None*.
313314
314-
ACCEPTS: a Path instance and a Transform instance, a Patch
315-
instance, or None
315+
ACCEPTS: a :class:`~matplotlib.path.Path` instance and a
316+
:class:`~matplotlib.transforms.Transform` instance, a
317+
:class:`~matplotlib.patches.Patch` instance, or *None*.
316318
"""
317319
from patches import Patch, Rectangle
318320

@@ -371,8 +373,9 @@ def get_clip_path(self):
371373

372374
def get_transformed_clip_path_and_affine(self):
373375
'''
374-
Return the clip path with the non-affine part of its transformation applied,
375-
and the remaining affine part of its transformation.
376+
Return the clip path with the non-affine part of its
377+
transformation applied, and the remaining affine part of its
378+
transformation.
376379
'''
377380
if self._clippath is not None:
378381
return self._clippath.get_transformed_path_and_affine()
@@ -459,7 +462,7 @@ def get_label(self):
459462

460463
def set_label(self, s):
461464
"""
462-
Set the line label to s for auto legend
465+
Set the line label to *s* for auto legend
463466
464467
ACCEPTS: any string
465468
"""
@@ -495,7 +498,7 @@ def update_from(self, other):
495498

496499
def set(self, **kwargs):
497500
"""
498-
A tkstyle set command, pass kwargs to set properties
501+
A tkstyle set command, pass *kwargs* to set properties
499502
"""
500503
ret = []
501504
for k,v in kwargs.items():
@@ -526,8 +529,8 @@ def __init__(self, o):
526529

527530
def get_aliases(self):
528531
"""
529-
Get a dict mapping *fullname* -> *alias* for each alias in the
530-
:class:`~matplotlib.artist.ArtistInspector`.
532+
Get a dict mapping *fullname* -> *alias* for each *alias* in
533+
the :class:`~matplotlib.artist.ArtistInspector`.
531534
532535
Eg., for lines::
533536
@@ -553,7 +556,7 @@ def get_valid_values(self, attr):
553556
"""
554557
Get the legal arguments for the setter associated with *attr*.
555558
556-
This is done by querying the docstring of the function set_ *attr*
559+
This is done by querying the docstring of the function *set_attr*
557560
for a line that begins with ACCEPTS:
558561
559562
Eg., for a line linestyle, return
@@ -603,11 +606,11 @@ def is_alias(self, o):
603606

604607
def aliased_name(self, s):
605608
"""
606-
return 'PROPNAME or alias' if s has an alias, else return
609+
return 'PROPNAME or alias' if *s* has an alias, else return
607610
PROPNAME.
608611
609-
Eg for the line markerfacecolor property, which has an alias,
610-
return 'markerfacecolor or mfc' and for the transform
612+
E.g. for the line markerfacecolor property, which has an
613+
alias, return 'markerfacecolor or mfc' and for the transform
611614
property, which does not, return 'transform'
612615
"""
613616
if self.aliasd.has_key(s):
@@ -701,11 +704,11 @@ def getp(o, *args):
701704
getp can be used to query all the gettable properties with getp(o)
702705
Many properties have aliases for shorter typing, eg 'lw' is an
703706
alias for 'linewidth'. In the output, aliases and full property
704-
names will be listed as
707+
names will be listed as:
705708
706709
property or alias = value
707710
708-
eg
711+
e.g.:
709712
710713
linewidth or lw = 2
711714
"""
@@ -750,7 +753,7 @@ def setp(h, *args, **kwargs):
750753
:func:`setp` operates on a single instance or a list of instances.
751754
If you are in query mode introspecting the possible values, only
752755
the first instance in the sequence is used. When actually setting
753-
values, all the instances will be set. Eg., suppose you have a
756+
values, all the instances will be set. E.g., suppose you have a
754757
list of two lines, the following will make both lines thicker and
755758
red::
756759

0 commit comments

Comments
 (0)