@@ -26,8 +26,8 @@ def __init__(self, offset=(0., 0.)):
26
26
"""
27
27
Parameters
28
28
----------
29
- offset : pair of floats
30
- The offset to apply to the path, measured in points.
29
+ offset : (float, float), default: (0, 0)
30
+ The (x, y) offset to apply to the path, measured in points.
31
31
"""
32
32
self ._offset = offset
33
33
@@ -38,10 +38,10 @@ def _offset_transform(self, renderer):
38
38
39
39
def _update_gc (self , gc , new_gc_dict ):
40
40
"""
41
- Update the given GraphicsCollection with the given
42
- dictionary of properties. The keys in the dictionary are used to
43
- identify the appropriate set_ method on the gc.
41
+ Update the given GraphicsContext with the given dict of properties.
44
42
43
+ The keys in the dictionary are used to identify the appropriate
44
+ ``set_`` method on the *gc*.
45
45
"""
46
46
new_gc_dict = new_gc_dict .copy ()
47
47
@@ -61,7 +61,6 @@ def draw_path(self, renderer, gc, tpath, affine, rgbFace=None):
61
61
Derived should override this method. The arguments are the same
62
62
as :meth:`matplotlib.backend_bases.RendererBase.draw_path`
63
63
except the first argument is a renderer.
64
-
65
64
"""
66
65
# Get the real renderer, not a PathEffectRenderer.
67
66
if isinstance (renderer , PathEffectRenderer ):
@@ -227,8 +226,8 @@ def __init__(self, offset=(2, -2),
227
226
"""
228
227
Parameters
229
228
----------
230
- offset : pair of floats
231
- The offset of the shadow in points.
229
+ offset : (float, float), default: (2, -2)
230
+ The (x, y) offset of the shadow in points.
232
231
shadow_rgbFace : color
233
232
The shadow color.
234
233
alpha : float, default: 0.3
@@ -295,8 +294,8 @@ def __init__(self, offset=(2, -2),
295
294
"""
296
295
Parameters
297
296
----------
298
- offset : pair of floats
299
- The offset to apply to the path, in points.
297
+ offset : (float, float), default: (2, -2)
298
+ The (x, y) offset to apply to the path, in points.
300
299
shadow_color : color, default: 'black'
301
300
The shadow color.
302
301
A value of ``None`` takes the original artist's color
@@ -354,8 +353,8 @@ def __init__(self, offset=(0, 0), **kwargs):
354
353
"""
355
354
Parameters
356
355
----------
357
- offset : pair of floats
358
- The offset to apply to the path, in points.
356
+ offset : (float, float), default: (0, 0)
357
+ The (x, y) offset to apply to the path, in points.
359
358
**kwargs
360
359
All keyword arguments are passed through to the
361
360
:class:`~matplotlib.patches.PathPatch` constructor. The
@@ -401,8 +400,8 @@ def __init__(self, offset=(0, 0),
401
400
"""
402
401
Parameters
403
402
----------
404
- offset : pair of floats , default: (0, 0)
405
- The offset to apply to the path, in points.
403
+ offset : (float, float) , default: (0, 0)
404
+ The (x, y) offset to apply to the path, in points.
406
405
spacing : float, default: 10.0
407
406
The spacing between ticks in points.
408
407
angle : float, default: 45.0
@@ -430,9 +429,7 @@ def __init__(self, offset=(0, 0),
430
429
self ._gc = kwargs
431
430
432
431
def draw_path (self , renderer , gc , tpath , affine , rgbFace ):
433
- """
434
- Draw the path with updated gc.
435
- """
432
+ """Draw the path with updated gc."""
436
433
# Do not modify the input! Use copy instead.
437
434
gc0 = renderer .new_gc ()
438
435
gc0 .copy_properties (gc )
@@ -445,7 +442,7 @@ def draw_path(self, renderer, gc, tpath, affine, rgbFace):
445
442
[np .sin (theta ), np .cos (theta )]])
446
443
447
444
# Convert spacing parameter to pixels.
448
- spcpx = renderer .points_to_pixels (self ._spacing )
445
+ spacing_px = renderer .points_to_pixels (self ._spacing )
449
446
450
447
# Transform before evaluation because to_polygons works at resolution
451
448
# of one -- assuming it is working in pixel space.
@@ -469,11 +466,11 @@ def draw_path(self, renderer, gc, tpath, affine, rgbFace):
469
466
470
467
# Build parametric coordinate along curve
471
468
s = np .concatenate (([0.0 ], np .cumsum (ds )))
472
- stot = s [- 1 ]
469
+ s_total = s [- 1 ]
473
470
474
- num = int (np .ceil (stot / spcpx )) - 1
471
+ num = int (np .ceil (s_total / spacing_px )) - 1
475
472
# Pick parameter values for ticks.
476
- s_tick = np .linspace (spcpx / 2 , stot - spcpx / 2 , num )
473
+ s_tick = np .linspace (spacing_px / 2 , s_total - spacing_px / 2 , num )
477
474
478
475
# Find points along the parameterized curve
479
476
x_tick = np .interp (s_tick , s , x )
@@ -493,7 +490,7 @@ def draw_path(self, renderer, gc, tpath, affine, rgbFace):
493
490
uv [mask ] = np .array ([0 , 0 ]).T
494
491
495
492
# Rotate and scale unit vector into tick vector
496
- dxy = np .dot (uv , trans_matrix ) * self ._length * spcpx
493
+ dxy = np .dot (uv , trans_matrix ) * self ._length * spacing_px
497
494
498
495
# Build tick endpoints
499
496
x_end = x_tick + dxy [:, 0 ]
0 commit comments