@@ -59,33 +59,48 @@ def __init__(self, adir, v_intervalx, d_intervalx, axes, *args,
5959 # Do not depend on this existing in future releases!
6060 self ._axinfo = self ._AXINFO [adir ].copy ()
6161 if rcParams ['_internal.classic_mode' ]:
62- self ._axinfo .update (
63- {'label' : {'va' : 'center' ,
64- 'ha' : 'center' },
65- 'tick' : {'inward_factor' : 0.2 ,
66- 'outward_factor' : 0.1 ,
67- 'linewidth' : rcParams ['lines.linewidth' ]},
68- 'axisline' : {'linewidth' : 0.75 ,
69- 'color' : (0 , 0 , 0 , 1 )},
70- 'grid' : {'color' : (0.9 , 0.9 , 0.9 , 1 ),
71- 'linewidth' : 1.0 ,
72- 'linestyle' : '-' },
73- })
62+ self ._axinfo .update ({
63+ 'label' : {'va' : 'center' , 'ha' : 'center' },
64+ 'tick' : {
65+ 'inward_factor' : 0.2 ,
66+ 'outward_factor' : 0.1 ,
67+ 'linewidth' : {
68+ True : rcParams ['lines.linewidth' ], # major
69+ False : rcParams ['lines.linewidth' ], # minor
70+ }
71+ },
72+ 'axisline' : {'linewidth' : 0.75 , 'color' : (0 , 0 , 0 , 1 )},
73+ 'grid' : {
74+ 'color' : (0.9 , 0.9 , 0.9 , 1 ),
75+ 'linewidth' : 1.0 ,
76+ 'linestyle' : '-' ,
77+ },
78+ })
7479 else :
75- self ._axinfo .update (
76- {'label' : {'va' : 'center' ,
77- 'ha' : 'center' },
78- 'tick' : {'inward_factor' : 0.2 ,
79- 'outward_factor' : 0.1 ,
80- 'linewidth' : rcParams .get (
81- adir + 'tick.major.width' ,
82- rcParams ['xtick.major.width' ])},
83- 'axisline' : {'linewidth' : rcParams ['axes.linewidth' ],
84- 'color' : rcParams ['axes.edgecolor' ]},
85- 'grid' : {'color' : rcParams ['grid.color' ],
86- 'linewidth' : rcParams ['grid.linewidth' ],
87- 'linestyle' : rcParams ['grid.linestyle' ]},
88- })
80+ self ._axinfo .update ({
81+ 'label' : {'va' : 'center' , 'ha' : 'center' },
82+ 'tick' : {
83+ 'inward_factor' : 0.2 ,
84+ 'outward_factor' : 0.1 ,
85+ 'linewidth' : {
86+ True : ( # major
87+ rcParams ['xtick.major.width' ] if adir in 'xz' else
88+ rcParams ['ytick.major.width' ]),
89+ False : ( # minor
90+ rcParams ['xtick.minor.width' ] if adir in 'xz' else
91+ rcParams ['ytick.minor.width' ]),
92+ }
93+ },
94+ 'axisline' : {
95+ 'linewidth' : rcParams ['axes.linewidth' ],
96+ 'color' : rcParams ['axes.edgecolor' ],
97+ },
98+ 'grid' : {
99+ 'color' : rcParams ['grid.color' ],
100+ 'linewidth' : rcParams ['grid.linewidth' ],
101+ 'linestyle' : rcParams ['grid.linestyle' ],
102+ },
103+ })
89104
90105 maxis .XAxis .__init__ (self , axes , * args , ** kwargs )
91106
@@ -120,11 +135,17 @@ def init3d(self):
120135 def get_major_ticks (self , numticks = None ):
121136 ticks = maxis .XAxis .get_major_ticks (self , numticks )
122137 for t in ticks :
123- t .tick1line .set_transform (self .axes .transData )
124- t .tick2line .set_transform (self .axes .transData )
125- t .gridline .set_transform (self .axes .transData )
126- t .label1 .set_transform (self .axes .transData )
127- t .label2 .set_transform (self .axes .transData )
138+ for obj in [
139+ t .tick1line , t .tick2line , t .gridline , t .label1 , t .label2 ]:
140+ obj .set_transform (self .axes .transData )
141+ return ticks
142+
143+ def get_minor_ticks (self , numticks = None ):
144+ ticks = maxis .XAxis .get_minor_ticks (self , numticks )
145+ for t in ticks :
146+ for obj in [
147+ t .tick1line , t .tick2line , t .gridline , t .label1 , t .label2 ]:
148+ obj .set_transform (self .axes .transData )
128149 return ticks
129150
130151 def set_pane_pos (self , xys ):
@@ -370,7 +391,8 @@ def draw(self, renderer):
370391 lx , ly , lz = proj3d .proj_transform (* pos , renderer .M )
371392
372393 tick_update_position (tick , (x1 , x2 ), (y1 , y2 ), (lx , ly ))
373- tick .tick1line .set_linewidth (info ['tick' ]['linewidth' ])
394+ tick .tick1line .set_linewidth (
395+ info ['tick' ]['linewidth' ][tick ._major ])
374396 tick .draw (renderer )
375397
376398 renderer .close_group ('axis3d' )
0 commit comments