@@ -24,14 +24,20 @@ def compare_plot(comp_df, ax=None):
24
24
if ax is None :
25
25
_ , ax = plt .subplots ()
26
26
27
- yticks_pos = np .linspace (0 , - 1 , (comp_df .shape [0 ] * 2 ) - 1 )
28
- yticks_labels = np .repeat (comp_df .index , 2 )[1 :]
27
+ yticks_pos , step = np .linspace (0 , - 1 , (comp_df .shape [0 ] * 2 ) - 1 , retstep = True )
28
+ yticks_pos [1 ::2 ] = yticks_pos [1 ::2 ] + step / 2
29
+
30
+ yticks_labels = ['' ] * len (yticks_pos )
31
+ yticks_labels [0 ] = comp_df .index [0 ]
32
+ yticks_labels [1 ::2 ] = comp_df .index [1 :]
29
33
30
34
data = comp_df .values
31
35
min_ic = data [0 , 0 ]
32
36
33
- ax .errorbar (x = data [:, 0 ], y = yticks_pos [::2 ], xerr = data [:, 4 ], fmt = 'ko' , mfc = 'None' , mew = 1 )
34
- ax .errorbar (x = data [1 :, 0 ], y = yticks_pos [1 ::2 ], xerr = data [1 :, 5 ], fmt = '^' , color = 'grey' )
37
+ ax .errorbar (x = data [:, 0 ], y = yticks_pos [::2 ], xerr = data [:, 4 ],
38
+ fmt = 'ko' , mfc = 'None' , mew = 1 )
39
+ ax .errorbar (x = data [1 :, 0 ], y = yticks_pos [1 ::2 ],
40
+ xerr = data [1 :, 5 ], fmt = '^' , color = 'grey' )
35
41
36
42
ax .plot (data [:, 0 ] - (2 * data [:, 1 ]), yticks_pos [::2 ], 'ko' )
37
43
ax .axvline (min_ic , ls = '--' , color = 'grey' )
0 commit comments