py2ls 0.2.4.5__py3-none-any.whl → 0.2.4.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- py2ls/.git/index +0 -0
- py2ls/bio.py +540 -47
- py2ls/ips.py +12 -3
- py2ls/mol.py +289 -0
- py2ls/plot.py +262 -100
- {py2ls-0.2.4.5.dist-info → py2ls-0.2.4.6.dist-info}/METADATA +1 -1
- {py2ls-0.2.4.5.dist-info → py2ls-0.2.4.6.dist-info}/RECORD +8 -7
- {py2ls-0.2.4.5.dist-info → py2ls-0.2.4.6.dist-info}/WHEEL +0 -0
py2ls/plot.py
CHANGED
@@ -11,7 +11,7 @@ import logging
|
|
11
11
|
import os
|
12
12
|
import re
|
13
13
|
from typing import Union
|
14
|
-
from .ips import fsave, fload, mkdir, listdir, figsave, strcmp, unique, get_os, ssplit,plt_font
|
14
|
+
from .ips import fsave, fload, mkdir, listdir, figsave, strcmp, unique, get_os, ssplit,flatten,plt_font
|
15
15
|
from .stats import *
|
16
16
|
from .netfinder import get_soup, fetch
|
17
17
|
|
@@ -1868,6 +1868,7 @@ def figsets(*args, **kwargs):
|
|
1868
1868
|
plt.rcParams["font.size"]=fontsize
|
1869
1869
|
fontname = kwargs.pop("fontname","Arial")
|
1870
1870
|
fontname=plt_font(fontname) # 显示中文
|
1871
|
+
|
1871
1872
|
sns_themes = ["white", "whitegrid", "dark", "darkgrid", "ticks"]
|
1872
1873
|
sns_contexts = ["notebook", "talk", "poster"] # now available "paper"
|
1873
1874
|
scienceplots_styles = [
|
@@ -3498,37 +3499,106 @@ def sns_func_info(dir_save=None):
|
|
3498
3499
|
)
|
3499
3500
|
|
3500
3501
|
|
3501
|
-
|
3502
|
-
|
3503
|
-
|
3504
|
-
|
3502
|
+
def get_color_overlap(*colors):
|
3503
|
+
import matplotlib.colors as mcolors
|
3504
|
+
|
3505
|
+
"""Blend multiple colors by averaging their RGB values."""
|
3506
|
+
rgbs = [mcolors.to_rgb(color) for color in colors]
|
3507
|
+
blended_rgb = [sum(channel) / len(channel) for channel in zip(*rgbs)]
|
3508
|
+
return mcolors.to_hex(blended_rgb)
|
3509
|
+
|
3510
|
+
|
3511
|
+
def desaturate_color(color, saturation_factor=0.5):
|
3512
|
+
"""Reduce the saturation of a color by a given factor (between 0 and 1)."""
|
3513
|
+
import matplotlib.colors as mcolors
|
3514
|
+
import colorsys
|
3515
|
+
# Convert the color to RGB
|
3516
|
+
rgb = mcolors.to_rgb(color)
|
3517
|
+
# Convert RGB to HLS (Hue, Lightness, Saturation)
|
3518
|
+
h, l, s = colorsys.rgb_to_hls(*rgb)
|
3519
|
+
# Reduce the saturation
|
3520
|
+
s *= saturation_factor
|
3521
|
+
# Convert back to RGB
|
3522
|
+
return colorsys.hls_to_rgb(h, l, s)
|
3523
|
+
|
3524
|
+
def textsets(text, fontname='Arial', fontsize=11, fontweight="normal", fontstyle="normal",
|
3525
|
+
fontcolor='k', backgroundcolor=None, shadow=False, ha="center", va="center"):
|
3526
|
+
if text: # Ensure text exists
|
3527
|
+
if fontname:
|
3528
|
+
text.set_fontname(plt_font(fontname))
|
3529
|
+
if fontsize:
|
3530
|
+
text.set_fontsize(fontsize)
|
3531
|
+
if fontweight:
|
3532
|
+
text.set_fontweight(fontweight)
|
3533
|
+
if fontstyle:
|
3534
|
+
text.set_fontstyle(fontstyle)
|
3535
|
+
if fontcolor:
|
3536
|
+
text.set_color(fontcolor)
|
3537
|
+
if backgroundcolor:
|
3538
|
+
text.set_backgroundcolor(backgroundcolor)
|
3539
|
+
text.set_horizontalalignment(ha)
|
3540
|
+
text.set_verticalalignment(va)
|
3541
|
+
if shadow:
|
3542
|
+
text.set_path_effects([
|
3543
|
+
matplotlib.patheffects.withStroke(linewidth=3, foreground="gray")
|
3544
|
+
])
|
3505
3545
|
def venn(
|
3506
3546
|
lists:list,
|
3507
|
-
labels:list,
|
3547
|
+
labels:list=None,
|
3508
3548
|
ax=None,
|
3509
3549
|
colors=None,
|
3510
|
-
edgecolor=
|
3511
|
-
alpha=0.
|
3512
|
-
|
3550
|
+
edgecolor=None,
|
3551
|
+
alpha=0.5,
|
3552
|
+
saturation=.75,
|
3553
|
+
linewidth=0, # default no edge
|
3513
3554
|
linestyle="-",
|
3514
3555
|
fontname='Arial',
|
3515
|
-
fontsize=
|
3556
|
+
fontsize=10,
|
3557
|
+
fontcolor='k',
|
3516
3558
|
fontweight="normal",
|
3517
3559
|
fontstyle="normal",
|
3518
|
-
|
3519
|
-
|
3520
|
-
|
3560
|
+
ha="center",
|
3561
|
+
va="center",
|
3562
|
+
shadow=False,
|
3563
|
+
subset_fontsize=10,
|
3521
3564
|
subset_fontweight="normal",
|
3522
3565
|
subset_fontstyle="normal",
|
3523
|
-
|
3524
|
-
|
3566
|
+
subset_fontcolor='k',
|
3567
|
+
backgroundcolor=None,
|
3525
3568
|
custom_texts=None,
|
3526
|
-
|
3527
|
-
|
3569
|
+
show_percentages=True, # display percentage
|
3570
|
+
fmt="{:.1%}",
|
3571
|
+
ellipse_shape=False, # 椭圆形
|
3572
|
+
ellipse_scale=[1.5, 1], #not perfect, 椭圆形的形状
|
3528
3573
|
**kwargs
|
3529
3574
|
):
|
3530
3575
|
"""
|
3531
3576
|
Advanced Venn diagram plotting function with extensive customization options.
|
3577
|
+
Usage:
|
3578
|
+
# Define the two sets
|
3579
|
+
set1 = [1, 2, 3, 4, 5]
|
3580
|
+
set2 = [4, 5, 6, 7, 8]
|
3581
|
+
set3 = [1, 2, 4, 7, 9, 10, 11, 6, 103]
|
3582
|
+
_, axs = plt.subplots(1, 2)
|
3583
|
+
venn(
|
3584
|
+
[set1, set2],
|
3585
|
+
["Set A", "Set B"],
|
3586
|
+
colors=["r", "b"],
|
3587
|
+
edgecolor="r",
|
3588
|
+
linewidth=0,
|
3589
|
+
ax=axs[0],
|
3590
|
+
)
|
3591
|
+
venn(
|
3592
|
+
[set1, set2, set3],
|
3593
|
+
["Set A", "Set B", "Set 3"],
|
3594
|
+
colors=["r", "g", "b"],
|
3595
|
+
saturation=0.8,
|
3596
|
+
linewidth=[3, 5, 7],
|
3597
|
+
linestyle=[":", "-", "--"],
|
3598
|
+
# edgecolor="r",
|
3599
|
+
# alpha=1,
|
3600
|
+
ax=axs[1],
|
3601
|
+
)
|
3532
3602
|
|
3533
3603
|
Parameters:
|
3534
3604
|
lists: list of sets, 2 or 3 sets
|
@@ -3551,126 +3621,218 @@ def venn(
|
|
3551
3621
|
subset_label_format: string, format for subset labels (e.g., "{:.2f}" for floats)
|
3552
3622
|
shadow: bool, add shadow effect to the patches
|
3553
3623
|
custom_texts: list of custom texts to replace the subset labels
|
3554
|
-
hatches: list of hatch patterns for the patches
|
3555
|
-
per_circle_styles: dict, custom styles for each circle (e.g., {'circle_1': {'color': 'red'}})
|
3556
3624
|
**kwargs: additional keyword arguments passed to venn2 or venn3
|
3557
3625
|
"""
|
3558
3626
|
if ax is None:
|
3559
3627
|
ax = plt.gca()
|
3560
3628
|
lists=[set(flatten(i, verbose=False)) for i in lists]
|
3561
3629
|
# Function to apply text styles to labels
|
3562
|
-
|
3563
|
-
if
|
3564
|
-
|
3565
|
-
|
3566
|
-
|
3567
|
-
|
3568
|
-
|
3569
|
-
|
3570
|
-
if fontstyle:
|
3571
|
-
text.set_fontstyle(fontstyle)
|
3572
|
-
# Alignment customization
|
3573
|
-
text.set_horizontalalignment(label_align)
|
3574
|
-
text.set_verticalalignment(label_baseline)
|
3575
|
-
|
3630
|
+
if colors is None:
|
3631
|
+
colors=["r","b"] if len(lists)==2 else ["r","g","b"]
|
3632
|
+
if labels is None:
|
3633
|
+
labels=["set1","set2"] if len(lists)==2 else ["set1","set2","set3"]
|
3634
|
+
if edgecolor is None:
|
3635
|
+
edgecolor=colors
|
3636
|
+
colors = [desaturate_color(color, saturation) for color in colors]
|
3637
|
+
# Check colors and auto-calculate overlaps
|
3576
3638
|
if len(lists) == 2:
|
3639
|
+
def get_count_and_percentage(set_count, subset_count):
|
3640
|
+
percent = subset_count / set_count if set_count > 0 else 0
|
3641
|
+
return f"{subset_count}\n({fmt.format(percent)})" if show_percentages else f"{subset_count}"
|
3642
|
+
|
3577
3643
|
from matplotlib_venn import venn2, venn2_circles
|
3644
|
+
# Auto-calculate overlap color for 2-set Venn diagram
|
3645
|
+
overlap_color = get_color_overlap(colors[0], colors[1]) if colors else None
|
3646
|
+
|
3647
|
+
# Draw the venn diagram
|
3578
3648
|
v = venn2(subsets=lists, set_labels=labels, ax=ax, **kwargs)
|
3579
|
-
venn_circles = venn2_circles(subsets=lists, ax=ax
|
3649
|
+
venn_circles = venn2_circles(subsets=lists, ax=ax)
|
3650
|
+
set1,set2=lists[0],lists[1]
|
3651
|
+
v.get_patch_by_id('10').set_color(colors[0])
|
3652
|
+
v.get_patch_by_id('01').set_color(colors[1])
|
3653
|
+
v.get_patch_by_id('11').set_color(get_color_overlap(colors[0], colors[1]) if colors else None)
|
3654
|
+
# v.get_label_by_id('10').set_text(len(set1 - set2))
|
3655
|
+
# v.get_label_by_id('01').set_text(len(set2 - set1))
|
3656
|
+
# v.get_label_by_id('11').set_text(len(set1 & set2))
|
3657
|
+
v.get_label_by_id('10').set_text(get_count_and_percentage(len(set1), len(set1 - set2)))
|
3658
|
+
v.get_label_by_id('01').set_text(get_count_and_percentage(len(set2), len(set2 - set1)))
|
3659
|
+
v.get_label_by_id('11').set_text(get_count_and_percentage(len(set1 | set2), len(set1 & set2)))
|
3660
|
+
|
3661
|
+
|
3580
3662
|
if not isinstance(linewidth,list):
|
3581
3663
|
linewidth=[linewidth]
|
3582
3664
|
if isinstance(linestyle,str):
|
3583
3665
|
linestyle=[linestyle]
|
3666
|
+
if not isinstance(edgecolor, list):
|
3667
|
+
edgecolor=[edgecolor]
|
3584
3668
|
linewidth=linewidth*2 if len(linewidth)==1 else linewidth
|
3585
3669
|
linestyle=linestyle*2 if len(linestyle)==1 else linestyle
|
3670
|
+
edgecolor=edgecolor*2 if len(edgecolor)==1 else edgecolor
|
3586
3671
|
for i in range(2):
|
3587
3672
|
venn_circles[i].set_lw(linewidth[i])
|
3588
3673
|
venn_circles[i].set_ls(linestyle[i])
|
3674
|
+
venn_circles[i].set_edgecolor(edgecolor[i])
|
3675
|
+
# 椭圆
|
3676
|
+
if ellipse_shape:
|
3677
|
+
import matplotlib.patches as patches
|
3678
|
+
for patch in v.patches:
|
3679
|
+
patch.set_visible(False) # Hide original patches if using ellipses
|
3680
|
+
center1 = v.get_circle_center(0)
|
3681
|
+
center2 = v.get_circle_center(1)
|
3682
|
+
ellipse1 = patches.Ellipse(
|
3683
|
+
(center1.x, center1.y),
|
3684
|
+
width=ellipse_scale[0],
|
3685
|
+
height=ellipse_scale[1],
|
3686
|
+
edgecolor=edgecolor[0] if edgecolor else colors[0],
|
3687
|
+
facecolor=colors[0],
|
3688
|
+
lw=linewidth if isinstance(linewidth, (int, float)) else 1.0, # Ensure lw is a number
|
3689
|
+
ls=linestyle[0],
|
3690
|
+
alpha=alpha if isinstance(alpha, (int, float)) else 0.5 # Ensure alpha is a number
|
3691
|
+
)
|
3692
|
+
ellipse2 = patches.Ellipse(
|
3693
|
+
(center2.x, center2.y),
|
3694
|
+
width=ellipse_scale[0],
|
3695
|
+
height=ellipse_scale[1],
|
3696
|
+
edgecolor=edgecolor[1] if edgecolor else colors[1],
|
3697
|
+
facecolor=colors[1],
|
3698
|
+
lw=linewidth if isinstance(linewidth, (int, float)) else 1.0, # Ensure lw is a number
|
3699
|
+
ls=linestyle[0],
|
3700
|
+
alpha=alpha if isinstance(alpha, (int, float)) else 0.5 # Ensure alpha is a number
|
3701
|
+
)
|
3702
|
+
ax.add_patch(ellipse1)
|
3703
|
+
ax.add_patch(ellipse2)
|
3589
3704
|
# Apply styles to set labels
|
3590
3705
|
for i, text in enumerate(v.set_labels):
|
3591
|
-
|
3706
|
+
textsets(text, fontname=fontname, fontsize=fontsize, fontweight=fontweight, fontstyle=fontstyle,
|
3707
|
+
fontcolor=fontcolor,ha=ha,va=va,shadow=shadow)
|
3592
3708
|
|
3593
3709
|
# Apply styles to subset labels
|
3594
3710
|
for i, text in enumerate(v.subset_labels):
|
3595
3711
|
if text: # Ensure text exists
|
3596
3712
|
if custom_texts: # Custom text handling
|
3597
|
-
text.set_text(custom_texts[i])
|
3598
|
-
|
3599
|
-
|
3600
|
-
|
3601
|
-
if i in [0, 1]
|
3602
|
-
else len(lists[0].intersection(lists[1]))
|
3603
|
-
)
|
3604
|
-
text.set_text(subset_label_format.format(subset_size))
|
3605
|
-
apply_text_style(
|
3606
|
-
text, None, subset_fontsize, subset_fontweight, subset_fontstyle
|
3607
|
-
)
|
3713
|
+
text.set_text(custom_texts[i])
|
3714
|
+
textsets(text, fontname=fontname, fontsize=subset_fontsize, fontweight=subset_fontweight, fontstyle=subset_fontstyle,
|
3715
|
+
fontcolor=subset_fontcolor,ha=ha,va=va,shadow=shadow)
|
3716
|
+
|
3608
3717
|
elif len(lists) == 3:
|
3718
|
+
def get_label(set_count, subset_count):
|
3719
|
+
percent = subset_count / set_count if set_count > 0 else 0
|
3720
|
+
return f"{subset_count}\n({fmt.format(percent)})" if show_percentages else f"{subset_count}"
|
3721
|
+
|
3609
3722
|
from matplotlib_venn import venn3, venn3_circles
|
3610
|
-
|
3611
|
-
|
3612
|
-
)
|
3613
|
-
|
3614
|
-
|
3615
|
-
|
3616
|
-
|
3617
|
-
|
3618
|
-
|
3619
|
-
|
3620
|
-
|
3621
|
-
|
3622
|
-
|
3623
|
-
|
3624
|
-
|
3723
|
+
# Auto-calculate overlap colors for 3-set Venn diagram
|
3724
|
+
colorAB = get_color_overlap(colors[0], colors[1]) if colors else None
|
3725
|
+
colorAC = get_color_overlap(colors[0], colors[2]) if colors else None
|
3726
|
+
colorBC = get_color_overlap(colors[1], colors[2]) if colors else None
|
3727
|
+
colorABC = get_color_overlap(colors[0], colors[1], colors[2]) if colors else None
|
3728
|
+
set1,set2,set3=lists[0],lists[1],lists[2]
|
3729
|
+
|
3730
|
+
# Draw the venn diagram
|
3731
|
+
v = venn3(subsets=lists, set_labels=labels, ax=ax,**kwargs)
|
3732
|
+
v.get_patch_by_id('100').set_color(colors[0])
|
3733
|
+
v.get_patch_by_id('010').set_color(colors[1])
|
3734
|
+
v.get_patch_by_id('001').set_color(colors[2])
|
3735
|
+
v.get_patch_by_id('110').set_color(colorAB)
|
3736
|
+
v.get_patch_by_id('101').set_color(colorAC)
|
3737
|
+
v.get_patch_by_id('011').set_color(colorBC)
|
3738
|
+
v.get_patch_by_id('111').set_color(colorABC)
|
3739
|
+
|
3740
|
+
# Correctly labeling subset sizes
|
3741
|
+
# v.get_label_by_id('100').set_text(len(set1 - set2 - set3))
|
3742
|
+
# v.get_label_by_id('010').set_text(len(set2 - set1 - set3))
|
3743
|
+
# v.get_label_by_id('001').set_text(len(set3 - set1 - set2))
|
3744
|
+
# v.get_label_by_id('110').set_text(len(set1 & set2 - set3))
|
3745
|
+
# v.get_label_by_id('101').set_text(len(set1 & set3 - set2))
|
3746
|
+
# v.get_label_by_id('011').set_text(len(set2 & set3 - set1))
|
3747
|
+
# v.get_label_by_id('111').set_text(len(set1 & set2 & set3))
|
3748
|
+
v.get_label_by_id('100').set_text(get_label(len(set1), len(set1 - set2 - set3)))
|
3749
|
+
v.get_label_by_id('010').set_text(get_label(len(set2), len(set2 - set1 - set3)))
|
3750
|
+
v.get_label_by_id('001').set_text(get_label(len(set3), len(set3 - set1 - set2)))
|
3751
|
+
v.get_label_by_id('110').set_text(get_label(len(set1 | set2), len(set1 & set2 - set3)))
|
3752
|
+
v.get_label_by_id('101').set_text(get_label(len(set1 | set3), len(set1 & set3 - set2)))
|
3753
|
+
v.get_label_by_id('011').set_text(get_label(len(set2 | set3), len(set2 & set3 - set1)))
|
3754
|
+
v.get_label_by_id('111').set_text(get_label(len(set1 | set2 | set3), len(set1 & set2 & set3)))
|
3755
|
+
|
3625
3756
|
|
3626
3757
|
# Apply styles to set labels
|
3627
3758
|
for i, text in enumerate(v.set_labels):
|
3628
|
-
|
3759
|
+
textsets(text, fontname=fontname, fontsize=fontsize, fontweight=fontweight, fontstyle=fontstyle,
|
3760
|
+
fontcolor=fontcolor,ha=ha,va=va,shadow=shadow)
|
3629
3761
|
|
3630
3762
|
# Apply styles to subset labels
|
3631
3763
|
for i, text in enumerate(v.subset_labels):
|
3632
3764
|
if text: # Ensure text exists
|
3633
3765
|
if custom_texts: # Custom text handling
|
3634
3766
|
text.set_text(custom_texts[i])
|
3635
|
-
|
3636
|
-
|
3637
|
-
|
3638
|
-
|
3639
|
-
|
3640
|
-
|
3641
|
-
|
3642
|
-
|
3643
|
-
|
3644
|
-
|
3767
|
+
textsets(text, fontname=fontname, fontsize=subset_fontsize, fontweight=subset_fontweight, fontstyle=subset_fontstyle,
|
3768
|
+
fontcolor=subset_fontcolor,ha=ha,va=va,shadow=shadow)
|
3769
|
+
|
3770
|
+
venn_circles = venn3_circles(subsets=lists, ax=ax)
|
3771
|
+
if not isinstance(linewidth,list):
|
3772
|
+
linewidth=[linewidth]
|
3773
|
+
if isinstance(linestyle,str):
|
3774
|
+
linestyle=[linestyle]
|
3775
|
+
if not isinstance(edgecolor, list):
|
3776
|
+
edgecolor=[edgecolor]
|
3777
|
+
linewidth=linewidth*3 if len(linewidth)==1 else linewidth
|
3778
|
+
linestyle=linestyle*3 if len(linestyle)==1 else linestyle
|
3779
|
+
edgecolor=edgecolor*3 if len(edgecolor)==1 else edgecolor
|
3780
|
+
|
3781
|
+
# edgecolor=[to_rgba(i) for i in edgecolor]
|
3782
|
+
|
3783
|
+
for i in range(3):
|
3784
|
+
venn_circles[i].set_lw(linewidth[i])
|
3785
|
+
venn_circles[i].set_ls(linestyle[i])
|
3786
|
+
venn_circles[i].set_edgecolor(edgecolor[i])
|
3787
|
+
|
3788
|
+
#椭圆形
|
3789
|
+
if ellipse_shape:
|
3790
|
+
import matplotlib.patches as patches
|
3791
|
+
for patch in v.patches:
|
3792
|
+
patch.set_visible(False) # Hide original patches if using ellipses
|
3793
|
+
center1 = v.get_circle_center(0)
|
3794
|
+
center2 = v.get_circle_center(1)
|
3795
|
+
center3 = v.get_circle_center(2)
|
3796
|
+
ellipse1 = patches.Ellipse(
|
3797
|
+
(center1.x, center1.y),
|
3798
|
+
width=ellipse_scale[0],
|
3799
|
+
height=ellipse_scale[1],
|
3800
|
+
edgecolor=edgecolor[0] if edgecolor else colors[0],
|
3801
|
+
facecolor=colors[0],
|
3802
|
+
lw=linewidth if isinstance(linewidth, (int, float)) else 1.0, # Ensure lw is a number
|
3803
|
+
ls=linestyle[0],
|
3804
|
+
alpha=alpha if isinstance(alpha, (int, float)) else 0.5 # Ensure alpha is a number
|
3805
|
+
)
|
3806
|
+
ellipse2 = patches.Ellipse(
|
3807
|
+
(center2.x, center2.y),
|
3808
|
+
width=ellipse_scale[0],
|
3809
|
+
height=ellipse_scale[1],
|
3810
|
+
edgecolor=edgecolor[1] if edgecolor else colors[1],
|
3811
|
+
facecolor=colors[1],
|
3812
|
+
lw=linewidth if isinstance(linewidth, (int, float)) else 1.0, # Ensure lw is a number
|
3813
|
+
ls=linestyle[0],
|
3814
|
+
alpha=alpha if isinstance(alpha, (int, float)) else 0.5 # Ensure alpha is a number
|
3815
|
+
)
|
3816
|
+
ellipse3 = patches.Ellipse(
|
3817
|
+
(center3.x, center3.y),
|
3818
|
+
width=ellipse_scale[0],
|
3819
|
+
height=ellipse_scale[1],
|
3820
|
+
edgecolor=edgecolor[1] if edgecolor else colors[1],
|
3821
|
+
facecolor=colors[1],
|
3822
|
+
lw=linewidth if isinstance(linewidth, (int, float)) else 1.0, # Ensure lw is a number
|
3823
|
+
ls=linestyle[0],
|
3824
|
+
alpha=alpha if isinstance(alpha, (int, float)) else 0.5 # Ensure alpha is a number
|
3825
|
+
)
|
3826
|
+
ax.add_patch(ellipse1)
|
3827
|
+
ax.add_patch(ellipse2)
|
3828
|
+
ax.add_patch(ellipse3)
|
3645
3829
|
else:
|
3646
3830
|
raise ValueError("只支持2或者3个list")
|
3647
|
-
|
3648
|
-
|
3831
|
+
|
3832
|
+
# Set transparency level
|
3833
|
+
for patch in v.patches:
|
3649
3834
|
if patch:
|
3650
|
-
if colors:
|
3651
|
-
patch.set_facecolor(colors[i % len(colors)])
|
3652
|
-
patch.set_edgecolor("none")
|
3653
3835
|
patch.set_alpha(alpha)
|
3654
|
-
if
|
3655
|
-
patch.
|
3656
|
-
|
3657
|
-
from matplotlib.patches import Shadow
|
3658
|
-
shadow_patch = Shadow(patch, -0.02, -0.02, alpha=0.2)
|
3659
|
-
ax.add_patch(shadow_patch)
|
3660
|
-
# # usage:
|
3661
|
-
# venn(
|
3662
|
-
# [rf_features, svm_features, lasso_features],
|
3663
|
-
# ["Random Forest", "SVM-RFE", "a"],
|
3664
|
-
# ax=axs[0], # Specify the axes
|
3665
|
-
# colors=["#BDC8E0", "#E5C0C1", "#D0E9CB"],
|
3666
|
-
# edgecolor="r",
|
3667
|
-
# alpha=1,
|
3668
|
-
# linewidth=[1, 2, 18],# 分别设置字体大小
|
3669
|
-
# linestyle=["-", "--", ":"],
|
3670
|
-
# fontsize=20,
|
3671
|
-
# label_baseline="top",
|
3672
|
-
# subset_label_format="{:.2f}%",
|
3673
|
-
# subset_fontsize=18,
|
3674
|
-
# shadow=False,
|
3675
|
-
# # custom_texts=["a", "b", "c"],
|
3676
|
-
# )
|
3836
|
+
if 'none' in edgecolor or 0 in linewidth:
|
3837
|
+
patch.set_edgecolor("none")
|
3838
|
+
return ax
|
@@ -17,7 +17,7 @@ py2ls/.git/hooks/pre-receive.sample,sha256=pMPSuce7P9jRRBwxvU7nGlldZrRPz0ndsxAlI
|
|
17
17
|
py2ls/.git/hooks/prepare-commit-msg.sample,sha256=6d3KpBif3dJe2X_Ix4nsp7bKFjkLI5KuMnbwyOGqRhk,1492
|
18
18
|
py2ls/.git/hooks/push-to-checkout.sample,sha256=pT0HQXmLKHxt16-mSu5HPzBeZdP0lGO7nXQI7DsSv18,2783
|
19
19
|
py2ls/.git/hooks/update.sample,sha256=jV8vqD4QPPCLV-qmdSHfkZT0XL28s32lKtWGCXoU0QY,3650
|
20
|
-
py2ls/.git/index,sha256=
|
20
|
+
py2ls/.git/index,sha256=sPKeqbWaVtDr3kILep6S-tkzgNPfGUog5UQ5meN6K-8,4232
|
21
21
|
py2ls/.git/info/exclude,sha256=ZnH-g7egfIky7okWTR8nk7IxgFjri5jcXAbuClo7DsE,240
|
22
22
|
py2ls/.git/logs/HEAD,sha256=8ID7WuAe_TlO9g-ARxhIJYdgdL3u3m7-1qrOanaIUlA,3535
|
23
23
|
py2ls/.git/logs/refs/heads/main,sha256=8ID7WuAe_TlO9g-ARxhIJYdgdL3u3m7-1qrOanaIUlA,3535
|
@@ -173,7 +173,7 @@ py2ls/LICENSE,sha256=UOZ1F5fFDe3XXvG4oNnkL1-Ecun7zpHzRxjp-XsMeAo,11324
|
|
173
173
|
py2ls/README.md,sha256=CwvJWAnSXnCnrVHlnEbrxxi6MbjbE_MT6DH2D53S818,11572
|
174
174
|
py2ls/__init__.py,sha256=Nn8jTIvySX7t7DMJ8VNRVctTStgXGjHldOIdZ35PdW8,165
|
175
175
|
py2ls/batman.py,sha256=E7gYofbDzN7S5oCmO_dd5Z1bxxhoYMJSD6s-VaF388E,11398
|
176
|
-
py2ls/bio.py,sha256=
|
176
|
+
py2ls/bio.py,sha256=LN7OdnRziBwLLQ_p90Ytp7X3gf2941au-rGVbaI73Tw,86920
|
177
177
|
py2ls/brain_atlas.py,sha256=w1o5EelRjq89zuFJUNSz4Da8HnTCwAwDAZ4NU4a-bAY,5486
|
178
178
|
py2ls/chat.py,sha256=Yr22GoIvoWhpV3m4fdwV_I0Mn77La346_ymSinR-ORA,3793
|
179
179
|
py2ls/correlators.py,sha256=RbOaJIPLCHJtUm5SFi_4dCJ7VFUPWR0PErfK3K26ad4,18243
|
@@ -214,16 +214,17 @@ py2ls/export_requirements.py,sha256=x2WgUF0jYKz9GfA1MVKN-MdsM-oQ8yUeC6Ua8oCymio,
|
|
214
214
|
py2ls/fetch_update.py,sha256=9LXj661GpCEFII2wx_99aINYctDiHni6DOruDs_fdt8,4752
|
215
215
|
py2ls/freqanalysis.py,sha256=F4218VSPbgL5tnngh6xNCYuNnfR-F_QjECUUxrPYZss,32594
|
216
216
|
py2ls/ich2ls.py,sha256=3E9R8oVpyYZXH5PiIQgT3CN5NxLe4Dwtm2LwaeacE6I,21381
|
217
|
-
py2ls/ips.py,sha256=
|
217
|
+
py2ls/ips.py,sha256=qYPAjm4b5t6gs0Ep4pSBnyPt88rK8LxZ4e-c4TSIksY,228131
|
218
218
|
py2ls/ml2ls.py,sha256=XSe2-sLNzUVSvVRkeRGfhrB_q8C49SDK1sekYC1Bats,50277
|
219
|
+
py2ls/mol.py,sha256=AZnHzarIk_MjueKdChqn1V6e4tUle3X1NnHSFA6n3Nw,10645
|
219
220
|
py2ls/netfinder.py,sha256=RJFr80tGEJiuwEx99IBOhI5-ZuXnPdWnGUYpF7XCEwI,56426
|
220
221
|
py2ls/ocr.py,sha256=5lhUbJufIKRSOL6wAWVLEo8TqMYSjoI_Q-IO-_4u3DE,31419
|
221
|
-
py2ls/plot.py,sha256=
|
222
|
+
py2ls/plot.py,sha256=qpBFmuWnn3TQancZXT08IsgSjTX33WA33I9eCRGekdw,154151
|
222
223
|
py2ls/setuptools-70.1.0-py3-none-any.whl,sha256=2bi3cUVal8ip86s0SOvgspteEF8SKLukECi-EWmFomc,882588
|
223
224
|
py2ls/sleep_events_detectors.py,sha256=bQA3HJqv5qnYKJJEIhCyhlDtkXQfIzqksnD0YRXso68,52145
|
224
225
|
py2ls/stats.py,sha256=DMoJd8Z5YV9T1wB-4P52F5K5scfVK55DT8UP4Twcebo,38627
|
225
226
|
py2ls/translator.py,sha256=zBeq4pYZeroqw3DT-5g7uHfVqKd-EQptT6LJ-Adi8JY,34244
|
226
227
|
py2ls/wb_detector.py,sha256=7y6TmBUj9exCZeIgBAJ_9hwuhkDh1x_-yg4dvNY1_GQ,6284
|
227
|
-
py2ls-0.2.4.
|
228
|
-
py2ls-0.2.4.
|
229
|
-
py2ls-0.2.4.
|
228
|
+
py2ls-0.2.4.6.dist-info/METADATA,sha256=hnTtItvGoftgpulPHRrUvM-k3kQRxJHd1cOhTPWEXxk,20038
|
229
|
+
py2ls-0.2.4.6.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
|
230
|
+
py2ls-0.2.4.6.dist-info/RECORD,,
|
File without changes
|