12
12
from . import art3d , proj3d
13
13
14
14
15
+ @_api .deprecated ("3.6" , alternative = "Vendor the code of _move_from_center" )
15
16
def move_from_center (coord , centers , deltas , axmask = (True , True , True )):
17
+ """
18
+ For each coordinate where *axmask* is True, move *coord* away from
19
+ *centers* by *deltas*.
20
+ """
21
+ return _move_from_center (coord , centers , deltas , axmask = axmask )
22
+
23
+
24
+ def _move_from_center (coord , centers , deltas , axmask = (True , True , True )):
16
25
"""
17
26
For each coordinate where *axmask* is True, move *coord* away from
18
27
*centers* by *deltas*.
@@ -21,8 +30,14 @@ def move_from_center(coord, centers, deltas, axmask=(True, True, True)):
21
30
return coord + axmask * np .copysign (1 , coord - centers ) * deltas
22
31
23
32
33
+ @_api .deprecated ("3.6" , alternative = "Vendor the code of _tick_update_position" )
24
34
def tick_update_position (tick , tickxs , tickys , labelpos ):
25
35
"""Update tick line and label position and style."""
36
+ _tick_update_position (tick , tickxs , tickys , labelpos )
37
+
38
+
39
+ def _tick_update_position (tick , tickxs , tickys , labelpos ):
40
+ """Update tick line and label position and style."""
26
41
27
42
tick .label1 .set_position (labelpos )
28
43
tick .label2 .set_position (labelpos )
@@ -370,7 +385,7 @@ def draw(self, renderer):
370
385
(self .labelpad + default_offset ) * deltas_per_point * deltas )
371
386
axmask = [True , True , True ]
372
387
axmask [index ] = False
373
- lxyz = move_from_center (lxyz , centers , labeldeltas , axmask )
388
+ lxyz = _move_from_center (lxyz , centers , labeldeltas , axmask )
374
389
tlx , tly , tlz = proj3d .proj_transform (* lxyz , self .axes .M )
375
390
self .label .set_position ((tlx , tly ))
376
391
if self .get_rotate_label (self .label .get_text ()):
@@ -391,7 +406,7 @@ def draw(self, renderer):
391
406
outeredgep = edgep2
392
407
outerindex = 1
393
408
394
- pos = move_from_center (outeredgep , centers , labeldeltas , axmask )
409
+ pos = _move_from_center (outeredgep , centers , labeldeltas , axmask )
395
410
olx , oly , olz = proj3d .proj_transform (* pos , self .axes .M )
396
411
self .offsetText .set_text (self .major .formatter .get_offset ())
397
412
self .offsetText .set_position ((olx , oly ))
@@ -491,10 +506,10 @@ def draw(self, renderer):
491
506
labeldeltas = (tick .get_pad () + default_label_offset ) * points
492
507
493
508
pos [tickdir ] = edgep1_tickdir
494
- pos = move_from_center (pos , centers , labeldeltas , axmask )
509
+ pos = _move_from_center (pos , centers , labeldeltas , axmask )
495
510
lx , ly , lz = proj3d .proj_transform (* pos , self .axes .M )
496
511
497
- tick_update_position (tick , (x1 , x2 ), (y1 , y2 ), (lx , ly ))
512
+ _tick_update_position (tick , (x1 , x2 ), (y1 , y2 ), (lx , ly ))
498
513
tick .tick1line .set_linewidth (tick_lw [tick ._major ])
499
514
tick .draw (renderer )
500
515
0 commit comments