@@ -539,7 +539,8 @@ def plot_qc(adata,
539
539
df_obs ['log10_' + ann ] = np .log10 (df_obs [ann ]+ 1 )
540
540
ann = 'log10_' + ann
541
541
if (i in hist_plot ):
542
- sc_i1 = sns .distplot (df_obs [ann ],vertical = True )
542
+ sc_i1 = sns .histplot (ax = ax_i , data = df_obs , y = ann )
543
+ # sc_i1 = sns.distplot(df_obs[ann],vertical=True)
543
544
ax_i .set_xticks ([])
544
545
else :
545
546
sc_i1 = sns .violinplot (ax = ax_i ,y = ann ,data = df_obs ,inner = None )
@@ -551,7 +552,8 @@ def plot_qc(adata,
551
552
df_var ['log10_' + ann ] = np .log10 (df_var [ann ]+ 1 )
552
553
ann = 'log10_' + ann
553
554
if (i in hist_plot ):
554
- sc_i1 = sns .distplot (df_var [ann ],vertical = True )
555
+ sc_i1 = sns .histplot (ax = ax_i , data = df_var , y = ann )
556
+ # sc_i1 = sns.distplot(df_var[ann],vertical=True)
555
557
ax_i .set_xticks ([])
556
558
else :
557
559
sc_i1 = sns .violinplot (ax = ax_i ,y = ann ,data = df_var ,inner = None )
@@ -1452,7 +1454,7 @@ def plot_dimension_reduction(adata,n_components = None,comp1=0,comp2=1,comp3=2,c
1452
1454
ax_i .scatter (df_plot_shuf ['Dim' + str (comp1 + 1 )], df_plot_shuf ['Dim' + str (comp2 + 1 )],df_plot_shuf ['Dim' + str (comp3 + 1 )],
1453
1455
c = colors_sns ,alpha = alpha ,linewidth = 0 ,
1454
1456
zorder = - 1 )
1455
- ax_i .legend (legend_sns [ 1 :] ,labels_sns [ 1 :] ,bbox_to_anchor = (1.03 , 0.5 ), loc = 'center left' , ncol = fig_legend_ncol ,
1457
+ ax_i .legend (legend_sns ,labels_sns ,bbox_to_anchor = (1.08 , 0.5 ), loc = 'center left' , ncol = fig_legend_ncol ,
1456
1458
frameon = False ,)
1457
1459
1458
1460
else :
@@ -1464,7 +1466,7 @@ def plot_dimension_reduction(adata,n_components = None,comp1=0,comp2=1,comp3=2,c
1464
1466
df_plot_shuf ['Dim' + str (comp3 + 1 )],
1465
1467
c = df_plot_shuf [ann ],vmin = vmin_i ,vmax = vmax_i ,alpha = alpha ,linewidth = 0 ,
1466
1468
zorder = - 1 )
1467
- cbar = plt .colorbar (sc_i ,ax = ax_i , pad = 0.04 , fraction = 0.05 , aspect = 30 )
1469
+ cbar = plt .colorbar (sc_i ,ax = ax_i , pad = 0.1 , fraction = 0.05 , aspect = 30 )
1468
1470
cbar .solids .set_edgecolor ("face" )
1469
1471
cbar .ax .locator_params (nbins = 5 )
1470
1472
if (show_graph ):
@@ -1505,7 +1507,7 @@ def plot_dimension_reduction(adata,n_components = None,comp1=0,comp2=1,comp3=2,c
1505
1507
else None
1506
1508
)
1507
1509
legend_handles , legend_labels = ax_i .get_legend_handles_labels ()
1508
- ax_i .legend (handles = legend_handles [ 1 :] , labels = legend_labels [ 1 :] ,
1510
+ ax_i .legend (handles = legend_handles , labels = legend_labels ,
1509
1511
bbox_to_anchor = (1 , 0.5 ), loc = 'center left' , ncol = fig_legend_ncol ,
1510
1512
frameon = False ,
1511
1513
)
@@ -2623,7 +2625,7 @@ def plot_flat_tree(adata,color=None,dist_scale=1,
2623
2625
if (ann + '_color' in adata .uns_keys ()) and (set (adata .uns [ann + '_color' ].keys ()) >= set (np .unique (df_plot_shuf [ann ]))) \
2624
2626
else None )
2625
2627
legend_handles , legend_labels = ax_i .get_legend_handles_labels ()
2626
- ax_i .legend (handles = legend_handles [ 1 :] , labels = legend_labels [ 1 :] ,
2628
+ ax_i .legend (handles = legend_handles , labels = legend_labels ,
2627
2629
bbox_to_anchor = (1 , 0.5 ), loc = 'center left' , ncol = fig_legend_ncol ,
2628
2630
frameon = False ,
2629
2631
)
@@ -2818,7 +2820,7 @@ def plot_visualization_2D(adata,method='umap',n_neighbors=50, nb_pct=None,perple
2818
2820
else None
2819
2821
)
2820
2822
legend_handles , legend_labels = ax_i .get_legend_handles_labels ()
2821
- ax_i .legend (handles = legend_handles [ 1 :] , labels = legend_labels [ 1 :] ,
2823
+ ax_i .legend (handles = legend_handles , labels = legend_labels ,
2822
2824
bbox_to_anchor = (1 , 0.5 ), loc = 'center left' , ncol = fig_legend_ncol ,
2823
2825
frameon = False ,
2824
2826
)
@@ -3008,7 +3010,7 @@ def plot_stream_sc(adata,root='S0',color=None,dist_scale=1,dist_pctl=95,preferen
3008
3010
else None
3009
3011
)
3010
3012
legend_handles , legend_labels = ax_i .get_legend_handles_labels ()
3011
- ax_i .legend (handles = legend_handles [ 1 :] , labels = legend_labels [ 1 :] ,
3013
+ ax_i .legend (handles = legend_handles , labels = legend_labels ,
3012
3014
bbox_to_anchor = (1 , 0.5 ), loc = 'center left' , ncol = fig_legend_ncol ,
3013
3015
frameon = False ,
3014
3016
)
0 commit comments