@@ -379,10 +379,10 @@ class AnchoredDirectionArrows(AnchoredOffsetbox):
379
379
@docstring .dedent
380
380
def __init__ (self , transform , label_x , label_y , length = 0.15 ,
381
381
fontsize = 0.08 , loc = 2 , angle = 0 , aspect_ratio = 1 , pad = 0.1 ,
382
- borderpad = 0.1 , frameon = False , color = 'black ' , alpha = 1 ,
382
+ borderpad = 0.1 , frameon = False , color = 'w ' , alpha = 1 ,
383
383
sep_x = 0.01 ,sep_y = 0 , fontproperties = None , back_length = 0.15 ,
384
384
head_width = 10 , head_length = 15 , tail_width = 2 ,
385
- lw = 0.5 , text_props = {} , arrow_props = {} ,
385
+ text_props = None , arrow_props = None ,
386
386
** kwargs ):
387
387
"""
388
388
Draw a direction indicator arrows
@@ -479,6 +479,12 @@ def __init__(self, transform, label_x, label_y, length=0.15,
479
479
size_vertical=0.5, color='white', \
480
480
fontproperties=fontprops)
481
481
"""
482
+ if arrow_props is None :
483
+ arrow_props = {}
484
+
485
+ if text_props is None :
486
+ text_props = {}
487
+
482
488
arrowstyle = ArrowStyle ("Simple" ,
483
489
head_width = head_width ,
484
490
head_length = head_length ,
@@ -487,6 +493,8 @@ def __init__(self, transform, label_x, label_y, length=0.15,
487
493
if fontproperties is None and 'prop' in kwargs :
488
494
fontproperties = kwargs .pop ('prop' )
489
495
496
+ print (bool (arrow_props ))
497
+
490
498
if 'color' not in arrow_props :
491
499
arrow_props ['color' ] = color
492
500
@@ -495,14 +503,10 @@ def __init__(self, transform, label_x, label_y, length=0.15,
495
503
496
504
if 'color' not in text_props :
497
505
text_props ['color' ] = color
498
- text_props ['ec' ] = color
499
506
500
507
if 'alpha' not in text_props :
501
508
text_props ['alpha' ] = alpha
502
509
503
- if 'lw' not in text_props :
504
- text_props ['lw' ] = lw
505
-
506
510
t_start = transform
507
511
t = transforms .Affine2D ().rotate_deg (angle )
508
512
t_end = t_start + t
@@ -513,29 +517,51 @@ def __init__(self, transform, label_x, label_y, length=0.15,
513
517
length_x = length
514
518
length_y = length * aspect_ratio
515
519
516
- self .arrow_x = FancyArrowPatch (
520
+ self .arrow_x_face = FancyArrowPatch (
521
+ (0 ,back_length * length_y ),
522
+ (length_x ,back_length * length_y ),
523
+ arrowstyle = arrowstyle ,
524
+ shrinkA = 0.0 ,
525
+ shrinkB = 0.0 ,
526
+ ** arrow_props )
527
+ self .arrow_x_face .set_ec ('None' )
528
+
529
+ self .arrow_x_edge = FancyArrowPatch (
517
530
(0 ,back_length * length_y ),
518
531
(length_x ,back_length * length_y ),
519
532
arrowstyle = arrowstyle ,
520
533
shrinkA = 0.0 ,
521
534
shrinkB = 0.0 ,
522
535
** arrow_props )
536
+ self .arrow_x_edge .set_fc ('None' )
537
+
538
+ self .arrow_y_face = FancyArrowPatch (
539
+ (back_length * length_x ,0 ),
540
+ (back_length * length_x ,length_y ),
541
+ arrowstyle = arrowstyle ,
542
+ shrinkA = 0.0 ,
543
+ shrinkB = 0.0 ,
544
+ ** arrow_props )
545
+ self .arrow_y_face .set_ec ('None' )
523
546
524
- self .arrow_y = FancyArrowPatch (
547
+ self .arrow_y_edge = FancyArrowPatch (
525
548
(back_length * length_x ,0 ),
526
549
(back_length * length_x ,length_y ),
527
550
arrowstyle = arrowstyle ,
528
551
shrinkA = 0.0 ,
529
552
shrinkB = 0.0 ,
530
553
** arrow_props )
554
+ self .arrow_y_edge .set_fc ('None' )
531
555
532
- self ._box .add_artist (self .arrow_x )
533
- self ._box .add_artist (self .arrow_y )
556
+ self ._box .add_artist (self .arrow_x_edge )
557
+ self ._box .add_artist (self .arrow_y_edge )
558
+ self ._box .add_artist (self .arrow_x_face )
559
+ self ._box .add_artist (self .arrow_y_face )
534
560
535
561
#Label X
536
562
text_path_x = TextPath ((
537
563
length_x + sep_x , back_length * length_y + sep_y ), label_x ,
538
- size = fontsize , prop = fontproperties , roatation = angle )
564
+ size = fontsize , prop = fontproperties )
539
565
self .p_x = PathPatch (text_path_x , transform = t_start , ** text_props )
540
566
self ._box .add_artist (self .p_x )
541
567
0 commit comments