py2ls 0.2.4.23__py3-none-any.whl → 0.2.4.25__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- py2ls/.DS_Store +0 -0
- py2ls/.git/.DS_Store +0 -0
- py2ls/.git/index +0 -0
- py2ls/.git/objects/.DS_Store +0 -0
- py2ls/.git/refs/.DS_Store +0 -0
- py2ls/data/.DS_Store +0 -0
- py2ls/data/styles/.DS_Store +0 -0
- py2ls/ec2ls.py +61 -0
- py2ls/ips.py +297 -229
- py2ls/ml2ls.py +996 -155
- py2ls/nl2ls.py +283 -0
- py2ls/plot.py +351 -40
- {py2ls-0.2.4.23.dist-info → py2ls-0.2.4.25.dist-info}/METADATA +1 -1
- {py2ls-0.2.4.23.dist-info → py2ls-0.2.4.25.dist-info}/RECORD +15 -11
- py2ls/ml2ls copy.py +0 -2906
- {py2ls-0.2.4.23.dist-info → py2ls-0.2.4.25.dist-info}/WHEEL +0 -0
py2ls/plot.py
CHANGED
@@ -2475,7 +2475,8 @@ def get_color(
|
|
2475
2475
|
"#B25E9D",
|
2476
2476
|
"#4B8C3B",
|
2477
2477
|
"#EF8632",
|
2478
|
-
"#24578E"
|
2478
|
+
"#24578E",
|
2479
|
+
"#FF2C00",
|
2479
2480
|
]
|
2480
2481
|
elif n == 8:
|
2481
2482
|
# colorlist = ['#1f77b4','#ff7f0e','#367B7F','#51B34F','#d62728','#aa40fc','#e377c2','#17becf']
|
@@ -3199,9 +3200,12 @@ def plotxy(
|
|
3199
3200
|
zorder = 0
|
3200
3201
|
for k in kind_:
|
3201
3202
|
# preprocess data
|
3202
|
-
|
3203
|
-
|
3204
|
-
|
3203
|
+
try:
|
3204
|
+
data=df_preprocessing_(data, kind=k)
|
3205
|
+
if 'variable' in data.columns and 'value' in data.columns:
|
3206
|
+
x,y='variable','value'
|
3207
|
+
except Exception as e:
|
3208
|
+
print(e)
|
3205
3209
|
zorder += 1
|
3206
3210
|
# indicate 'col' features
|
3207
3211
|
col = kwargs.get("col", None)
|
@@ -4496,18 +4500,19 @@ def subplot(
|
|
4496
4500
|
#! radar chart
|
4497
4501
|
def radar(
|
4498
4502
|
data: pd.DataFrame,
|
4499
|
-
|
4503
|
+
columns=None,
|
4500
4504
|
ylim=(0, 100),
|
4501
|
-
|
4505
|
+
facecolor=get_color(5),
|
4506
|
+
edgecolor="none",
|
4507
|
+
edge_linewidth=0.5,
|
4502
4508
|
fontsize=10,
|
4503
4509
|
fontcolor="k",
|
4504
4510
|
size=6,
|
4505
4511
|
linewidth=1,
|
4506
4512
|
linestyle="-",
|
4507
|
-
alpha=0.
|
4513
|
+
alpha=0.3,
|
4514
|
+
fmt=".1f",
|
4508
4515
|
marker="o",
|
4509
|
-
edgecolor="none",
|
4510
|
-
edge_linewidth=0.5,
|
4511
4516
|
bg_color="0.8",
|
4512
4517
|
bg_alpha=None,
|
4513
4518
|
grid_interval_ratio=0.2,
|
@@ -4527,19 +4532,34 @@ def radar(
|
|
4527
4532
|
ax=None,
|
4528
4533
|
sp=2,
|
4529
4534
|
verbose=True,
|
4535
|
+
axis=0,
|
4530
4536
|
**kwargs,
|
4531
4537
|
):
|
4532
4538
|
"""
|
4533
4539
|
Example DATA:
|
4534
4540
|
df = pd.DataFrame(
|
4535
|
-
|
4536
|
-
|
4537
|
-
|
4538
|
-
|
4539
|
-
|
4540
|
-
|
4541
|
-
|
4542
|
-
|
4541
|
+
data=[
|
4542
|
+
[80, 90, 60],
|
4543
|
+
[80, 20, 90],
|
4544
|
+
[80, 95, 20],
|
4545
|
+
[80, 95, 20],
|
4546
|
+
[80, 30, 100],
|
4547
|
+
[80, 30, 90],
|
4548
|
+
[80, 80, 50],
|
4549
|
+
],
|
4550
|
+
index=["HP", "MP", "ATK", "DEF", "SP.ATK", "SP.DEF", "SPD"],
|
4551
|
+
columns=["Hero", "Warrior", "Wizard"],
|
4552
|
+
)
|
4553
|
+
usage 1:
|
4554
|
+
radar(data=df)
|
4555
|
+
usage 2:
|
4556
|
+
radar(data=df["Wizard"])
|
4557
|
+
usage 3:
|
4558
|
+
radar(data=df, columns="Wizard")
|
4559
|
+
usage 4:
|
4560
|
+
nexttile = subplot(1, 2)
|
4561
|
+
radar(data=df, columns="Wizard", ax=nexttile(projection="polar"))
|
4562
|
+
pie(data=df, columns="Wizard", ax=nexttile(), width=0.5, pctdistance=0.7)
|
4543
4563
|
Parameters:
|
4544
4564
|
- data (pd.DataFrame): The data to plot. Each column corresponds to a variable, and each row represents a data point.
|
4545
4565
|
- ylim (tuple): The limits of the radial axis (y-axis). Default is (0, 100).
|
@@ -4556,7 +4576,6 @@ def radar(
|
|
4556
4576
|
- edge_linewidth (int): Line width for the marker edges.
|
4557
4577
|
- bg_color (str): Background color for the radar chart.
|
4558
4578
|
- grid_interval_ratio (float): Determines the intervals for the grid lines as a fraction of the y-limit.
|
4559
|
-
- title (str): The title of the radar chart.
|
4560
4579
|
- cmap (str): The colormap to use if `color` is a list.
|
4561
4580
|
- legend_loc (str): The location of the legend.
|
4562
4581
|
- legend_fontsize (int): Font size for the legend.
|
@@ -4573,22 +4592,22 @@ def radar(
|
|
4573
4592
|
- sp (int): Padding for the ticks from the plot area.
|
4574
4593
|
- **kwargs: Additional arguments for customization.
|
4575
4594
|
"""
|
4576
|
-
if run_once_within() and verbose:
|
4595
|
+
if run_once_within(20,reverse=True) and verbose:
|
4577
4596
|
usage_="""usage:
|
4578
4597
|
radar(
|
4579
4598
|
data: pd.DataFrame, #The data to plot. Each column corresponds to a variable, and each row represents a data point.
|
4580
|
-
title="Radar Chart",
|
4581
4599
|
ylim=(0, 100),# ylim (tuple): The limits of the radial axis (y-axis). Default is (0, 100).
|
4582
|
-
|
4600
|
+
facecolor=get_color(5),#The color(s) for the plot. Can be a single color or a list of colors.
|
4601
|
+
edgecolor="none",#for the marker edges.
|
4602
|
+
edge_linewidth=0.5,#for the marker edges.
|
4583
4603
|
fontsize=10,# Font size for the angular labels (x-axis).
|
4584
4604
|
fontcolor="k",# Color for the angular labels.
|
4585
4605
|
size=6,#The size of the markers for each data point.
|
4586
4606
|
linewidth=1,
|
4587
4607
|
linestyle="-",
|
4588
4608
|
alpha=0.5,#for the filled area.
|
4609
|
+
fmt=".1f",
|
4589
4610
|
marker="o",# for the data points.
|
4590
|
-
edgecolor="none",#for the marker edges.
|
4591
|
-
edge_linewidth=0.5,#for the marker edges.
|
4592
4611
|
bg_color="0.8",
|
4593
4612
|
bg_alpha=None,
|
4594
4613
|
grid_interval_ratio=0.2,#Determines the intervals for the grid lines as a fraction of the y-limit.
|
@@ -4618,9 +4637,25 @@ def radar(
|
|
4618
4637
|
kws_figsets = v_arg
|
4619
4638
|
kwargs.pop(k_arg, None)
|
4620
4639
|
break
|
4621
|
-
|
4640
|
+
if axis==1:
|
4641
|
+
data=data.T
|
4642
|
+
if isinstance(data, dict):
|
4643
|
+
data = pd.DataFrame(pd.Series(data))
|
4644
|
+
if ~isinstance(data, pd.DataFrame):
|
4645
|
+
data=pd.DataFrame(data)
|
4646
|
+
if isinstance(data, pd.DataFrame):
|
4647
|
+
data=data.select_dtypes(include=np.number)
|
4648
|
+
if isinstance(columns,str):
|
4649
|
+
columns=[columns]
|
4650
|
+
if columns is None:
|
4651
|
+
columns = list(data.columns)
|
4652
|
+
data=data[columns]
|
4653
|
+
categories = list(data.index)
|
4622
4654
|
num_vars = len(categories)
|
4623
4655
|
|
4656
|
+
# Set y-axis limits and grid intervals
|
4657
|
+
vmin, vmax = ylim
|
4658
|
+
|
4624
4659
|
# Set up angle for each category on radar chart
|
4625
4660
|
angles = np.linspace(0, 2 * np.pi, num_vars, endpoint=False).tolist()
|
4626
4661
|
angles += angles[:1] # Complete the loop to ensure straight-line connections
|
@@ -4644,9 +4679,6 @@ def radar(
|
|
4644
4679
|
# Draw one axis per variable and add labels
|
4645
4680
|
ax.set_xticks(angles[:-1])
|
4646
4681
|
ax.set_xticklabels(categories)
|
4647
|
-
|
4648
|
-
# Set y-axis limits and grid intervals
|
4649
|
-
vmin, vmax = ylim
|
4650
4682
|
if circular:
|
4651
4683
|
# * cicular style
|
4652
4684
|
ax.yaxis.set_ticks(np.arange(vmin, vmax + 1, vmax * grid_interval_ratio))
|
@@ -4669,7 +4701,7 @@ def radar(
|
|
4669
4701
|
else:
|
4670
4702
|
# * spider style: spider-style grid (straight lines, not circles)
|
4671
4703
|
# Create the spider-style grid (straight lines, not circles)
|
4672
|
-
for i in range(1, int(vmax * grid_interval_ratio) + 1):
|
4704
|
+
for i in range(1, int((vmax-vmin)/ ((vmax-vmin)*grid_interval_ratio))):#int(vmax * grid_interval_ratio) + 1):
|
4673
4705
|
ax.plot(
|
4674
4706
|
angles + [angles[0]], # Closing the loop
|
4675
4707
|
[i * vmax * grid_interval_ratio] * (num_vars + 1)
|
@@ -4680,7 +4712,7 @@ def radar(
|
|
4680
4712
|
linewidth=grid_linewidth,
|
4681
4713
|
)
|
4682
4714
|
# set bg_color
|
4683
|
-
ax.fill(angles, [vmax] * (data.shape[
|
4715
|
+
ax.fill(angles, [vmax] * (data.shape[0] + 1), color=bg_color, alpha=bg_alpha)
|
4684
4716
|
ax.yaxis.grid(False)
|
4685
4717
|
# Move radial labels away from plotted line
|
4686
4718
|
if tick_loc is None:
|
@@ -4702,14 +4734,20 @@ def radar(
|
|
4702
4734
|
ax.tick_params(axis="x", pad=sp) # move spines outward
|
4703
4735
|
ax.tick_params(axis="y", pad=sp) # move spines outward
|
4704
4736
|
# colors
|
4705
|
-
|
4706
|
-
|
4707
|
-
|
4708
|
-
|
4709
|
-
|
4737
|
+
if facecolor is not None:
|
4738
|
+
if not isinstance(facecolor,list):
|
4739
|
+
facecolor=[facecolor]
|
4740
|
+
colors = facecolor
|
4741
|
+
else:
|
4742
|
+
colors = (
|
4743
|
+
get_color(data.shape[0])
|
4744
|
+
if cmap is None
|
4745
|
+
else plt.get_cmap(cmap)(np.linspace(0, 1, data.shape[0]))
|
4746
|
+
)
|
4747
|
+
|
4710
4748
|
# Plot each row with straight lines
|
4711
|
-
for i, (
|
4712
|
-
values =
|
4749
|
+
for i, (col, val) in enumerate(data.items()):
|
4750
|
+
values = val.tolist()
|
4713
4751
|
values += values[:1] # Close the loop
|
4714
4752
|
ax.plot(
|
4715
4753
|
angles,
|
@@ -4717,7 +4755,7 @@ def radar(
|
|
4717
4755
|
color=colors[i],
|
4718
4756
|
linewidth=linewidth,
|
4719
4757
|
linestyle=linestyle,
|
4720
|
-
label=
|
4758
|
+
label=col,
|
4721
4759
|
clip_on=False,
|
4722
4760
|
)
|
4723
4761
|
ax.fill(angles, values, color=colors[i], alpha=alpha)
|
@@ -4748,7 +4786,7 @@ def radar(
|
|
4748
4786
|
ax.text(
|
4749
4787
|
angle,
|
4750
4788
|
offset_radius,
|
4751
|
-
|
4789
|
+
f"{value:{fmt}}",
|
4752
4790
|
ha="center",
|
4753
4791
|
va="center",
|
4754
4792
|
fontsize=fontsize,
|
@@ -4759,10 +4797,10 @@ def radar(
|
|
4759
4797
|
|
4760
4798
|
ax.set_ylim(ylim)
|
4761
4799
|
# Add markers for each data point
|
4762
|
-
for i,
|
4800
|
+
for i, (col, val) in enumerate(data.items()):
|
4763
4801
|
ax.plot(
|
4764
4802
|
angles,
|
4765
|
-
list(
|
4803
|
+
list(val) + [val[0]], # Close the loop for markers
|
4766
4804
|
color=colors[i],
|
4767
4805
|
marker=marker,
|
4768
4806
|
markersize=size,
|
@@ -4787,3 +4825,276 @@ def radar(
|
|
4787
4825
|
**kws_figsets,
|
4788
4826
|
)
|
4789
4827
|
return ax
|
4828
|
+
|
4829
|
+
|
4830
|
+
def pie(
|
4831
|
+
data:pd.Series,
|
4832
|
+
columns:list = None,
|
4833
|
+
facecolor=None,
|
4834
|
+
explode=[0.1],
|
4835
|
+
startangle=90,
|
4836
|
+
shadow=True,
|
4837
|
+
fontcolor="k",
|
4838
|
+
fmt=".2f",
|
4839
|
+
width=None,# the center blank
|
4840
|
+
pctdistance=0.85,
|
4841
|
+
labeldistance=1.1,
|
4842
|
+
kws_wedge={},
|
4843
|
+
kws_text={},
|
4844
|
+
center=(0, 0),
|
4845
|
+
radius=1,
|
4846
|
+
frame=False,
|
4847
|
+
fontsize=10,
|
4848
|
+
edgecolor="white",
|
4849
|
+
edgewidth=1,
|
4850
|
+
cmap=None,
|
4851
|
+
show_value=False,
|
4852
|
+
show_label=True,# False: only show the outer layer, if it is None, not show
|
4853
|
+
show_legend=True,
|
4854
|
+
legend_loc="upper right",
|
4855
|
+
bbox_to_anchor=[1.4, 1.1],
|
4856
|
+
legend_fontsize=10,
|
4857
|
+
rotation_correction=0,
|
4858
|
+
verbose=True,
|
4859
|
+
ax=None,
|
4860
|
+
**kwargs
|
4861
|
+
):
|
4862
|
+
|
4863
|
+
if run_once_within(20,reverse=True) and verbose:
|
4864
|
+
usage_="""usage:
|
4865
|
+
pie(
|
4866
|
+
data:pd.Series,
|
4867
|
+
columns:list = None,
|
4868
|
+
facecolor=None,
|
4869
|
+
explode=[0.1],
|
4870
|
+
startangle=90,
|
4871
|
+
shadow=True,
|
4872
|
+
fontcolor="k",
|
4873
|
+
fmt=".2f",
|
4874
|
+
width=None,# the center blank
|
4875
|
+
pctdistance=0.85,
|
4876
|
+
labeldistance=1.1,
|
4877
|
+
kws_wedge={},
|
4878
|
+
kws_text={},
|
4879
|
+
center=(0, 0),
|
4880
|
+
radius=1,
|
4881
|
+
frame=False,
|
4882
|
+
fontsize=10,
|
4883
|
+
edgecolor="white",
|
4884
|
+
edgewidth=1,
|
4885
|
+
cmap=None,
|
4886
|
+
show_value=False,
|
4887
|
+
show_label=True,# False: only show the outer layer, if it is None, not show
|
4888
|
+
show_legend=True,
|
4889
|
+
legend_loc="upper right",
|
4890
|
+
bbox_to_anchor=[1.4, 1.1],
|
4891
|
+
legend_fontsize=10,
|
4892
|
+
rotation_correction=0,
|
4893
|
+
verbose=True,
|
4894
|
+
ax=None,
|
4895
|
+
**kwargs
|
4896
|
+
)
|
4897
|
+
|
4898
|
+
usage 1:
|
4899
|
+
data = {"Segment A": 30, "Segment B": 50, "Segment C": 20}
|
4900
|
+
|
4901
|
+
ax = pie(
|
4902
|
+
data=data,
|
4903
|
+
# columns="Segment A",
|
4904
|
+
explode=[0, 0.2, 0],
|
4905
|
+
# width=0.4,
|
4906
|
+
show_label=False,
|
4907
|
+
fontsize=10,
|
4908
|
+
# show_value=1,
|
4909
|
+
fmt=".3f",
|
4910
|
+
)
|
4911
|
+
|
4912
|
+
# prepare dataset
|
4913
|
+
df = pd.DataFrame(
|
4914
|
+
data=[
|
4915
|
+
[80, 90, 60],
|
4916
|
+
[80, 20, 90],
|
4917
|
+
[80, 95, 20],
|
4918
|
+
[80, 95, 20],
|
4919
|
+
[80, 30, 100],
|
4920
|
+
[80, 30, 90],
|
4921
|
+
[80, 80, 50],
|
4922
|
+
],
|
4923
|
+
index=["HP", "MP", "ATK", "DEF", "SP.ATK", "SP.DEF", "SPD"],
|
4924
|
+
columns=["Hero", "Warrior", "Wizard"],
|
4925
|
+
)
|
4926
|
+
usage 1: only plot one column
|
4927
|
+
pie(
|
4928
|
+
df,
|
4929
|
+
columns="Wizard",
|
4930
|
+
width=0.6,
|
4931
|
+
show_label=False,
|
4932
|
+
fmt=".0f",
|
4933
|
+
)
|
4934
|
+
usage 2:
|
4935
|
+
pie(df,columns=["Hero", "Warrior"],show_label=False)
|
4936
|
+
usage 3: set different width
|
4937
|
+
pie(df,
|
4938
|
+
columns=["Hero", "Warrior", "Wizard"],
|
4939
|
+
width=[0.3, 0.2, 0.2],
|
4940
|
+
show_label=False,
|
4941
|
+
fmt=".0f",
|
4942
|
+
)
|
4943
|
+
usage 4: set width the same for all columns
|
4944
|
+
pie(df,
|
4945
|
+
columns=["Hero", "Warrior", "Wizard"],
|
4946
|
+
width=0.2,
|
4947
|
+
show_label=False,
|
4948
|
+
fmt=".0f",
|
4949
|
+
)
|
4950
|
+
usage 5: adjust the labels' offset
|
4951
|
+
pie(df, columns="Wizard", width=0.6, show_label=False, fmt=".6f", labeldistance=1.2)
|
4952
|
+
|
4953
|
+
usage 6:
|
4954
|
+
nexttile = subplot(1, 2)
|
4955
|
+
radar(data=df, columns="Wizard", ax=nexttile(projection="polar"))
|
4956
|
+
pie(data=df, columns="Wizard", ax=nexttile(), width=0.5, pctdistance=0.7)
|
4957
|
+
"""
|
4958
|
+
print(usage_)
|
4959
|
+
# Convert data to a Pandas Series if needed
|
4960
|
+
if isinstance(data, dict):
|
4961
|
+
data = pd.DataFrame(pd.Series(data))
|
4962
|
+
if ~isinstance(data, pd.DataFrame):
|
4963
|
+
data=pd.DataFrame(data)
|
4964
|
+
|
4965
|
+
if isinstance(data, pd.DataFrame):
|
4966
|
+
data=data.select_dtypes(include=np.number)
|
4967
|
+
if isinstance(columns,str):
|
4968
|
+
columns=[columns]
|
4969
|
+
if columns is None:
|
4970
|
+
columns = list(data.columns)
|
4971
|
+
# data=data[columns]
|
4972
|
+
# columns = list(data.columns)
|
4973
|
+
# print(columns)
|
4974
|
+
# 选择部分数据
|
4975
|
+
df=data[columns]
|
4976
|
+
|
4977
|
+
if width is None:
|
4978
|
+
if df.shape[1]>1:
|
4979
|
+
width=1/(df.shape[1]+2)
|
4980
|
+
else:
|
4981
|
+
width=1
|
4982
|
+
if isinstance(width,(float,int)):
|
4983
|
+
width=[width]
|
4984
|
+
if len(width)<df.shape[1]:
|
4985
|
+
width=width*df.shape[1]
|
4986
|
+
if isinstance(radius,(float,int)):
|
4987
|
+
radius=[radius]
|
4988
|
+
radius_tile=[1]*df.shape[1]
|
4989
|
+
radius=radius_tile.copy()
|
4990
|
+
for i in range(1,df.shape[1]):
|
4991
|
+
radius[i]=radius_tile[i]-np.sum(width[:i])
|
4992
|
+
|
4993
|
+
# colors
|
4994
|
+
if facecolor is not None:
|
4995
|
+
if not isinstance(facecolor,list):
|
4996
|
+
facecolor=[facecolor]
|
4997
|
+
colors = facecolor
|
4998
|
+
else:
|
4999
|
+
colors = (
|
5000
|
+
get_color(data.shape[0])
|
5001
|
+
if cmap is None
|
5002
|
+
else plt.get_cmap(cmap)(np.linspace(0, 1, data.shape[0]))
|
5003
|
+
)
|
5004
|
+
# to check if facecolor is nested list or not
|
5005
|
+
is_nested = True if any(isinstance(i, list) for i in colors) else False
|
5006
|
+
inested = 0
|
5007
|
+
for column_,width_,radius_ in zip(columns, width,radius):
|
5008
|
+
if column_!=columns[0]:
|
5009
|
+
labels = data.index if show_label else None
|
5010
|
+
else:
|
5011
|
+
labels = data.index if show_label is not None else None
|
5012
|
+
data = df[column_]
|
5013
|
+
labels_legend=data.index
|
5014
|
+
sizes = data.values
|
5015
|
+
|
5016
|
+
# Set wedge and text properties if none are provided
|
5017
|
+
kws_wedge = kws_wedge or {"edgecolor": edgecolor, "linewidth": edgewidth}
|
5018
|
+
kws_wedge.update({"width":width_})
|
5019
|
+
fontcolor=kws_text.get("color",fontcolor)
|
5020
|
+
fontsize=kws_text.get("fontsize",fontsize)
|
5021
|
+
kws_text.update({"color": fontcolor, "fontsize": fontsize})
|
5022
|
+
|
5023
|
+
if ax is None:
|
5024
|
+
ax=plt.gca()
|
5025
|
+
if explode is not None:
|
5026
|
+
if len(explode)<len(labels_legend):
|
5027
|
+
explode.extend([0]*(len(labels_legend)-len(explode)))
|
5028
|
+
|
5029
|
+
if fmt:
|
5030
|
+
if not fmt.startswith("%"):
|
5031
|
+
autopct =f"%{fmt}%%"
|
5032
|
+
else:
|
5033
|
+
autopct=None
|
5034
|
+
|
5035
|
+
if show_value is None:
|
5036
|
+
result = ax.pie(
|
5037
|
+
sizes,
|
5038
|
+
labels=labels,
|
5039
|
+
autopct= None,
|
5040
|
+
startangle=startangle + rotation_correction,
|
5041
|
+
explode=explode,
|
5042
|
+
colors=colors[inested] if is_nested else colors,
|
5043
|
+
shadow=shadow,
|
5044
|
+
pctdistance=pctdistance,
|
5045
|
+
labeldistance=labeldistance,
|
5046
|
+
wedgeprops=kws_wedge,
|
5047
|
+
textprops=kws_text,
|
5048
|
+
center=center,
|
5049
|
+
radius=radius_,
|
5050
|
+
frame=frame,
|
5051
|
+
**kwargs
|
5052
|
+
)
|
5053
|
+
else:
|
5054
|
+
result = ax.pie(
|
5055
|
+
sizes,
|
5056
|
+
labels=labels,
|
5057
|
+
autopct=autopct if autopct else None,
|
5058
|
+
startangle=startangle + rotation_correction,
|
5059
|
+
explode=explode,
|
5060
|
+
colors=colors[inested] if is_nested else colors,
|
5061
|
+
shadow=shadow,#shadow,
|
5062
|
+
pctdistance=pctdistance,
|
5063
|
+
labeldistance=labeldistance,
|
5064
|
+
wedgeprops=kws_wedge,
|
5065
|
+
textprops=kws_text,
|
5066
|
+
center=center,
|
5067
|
+
radius=radius_,
|
5068
|
+
frame=frame,
|
5069
|
+
**kwargs
|
5070
|
+
)
|
5071
|
+
if len(result) == 3:
|
5072
|
+
wedges, texts, autotexts = result
|
5073
|
+
elif len(result) == 2:
|
5074
|
+
wedges, texts = result
|
5075
|
+
autotexts = None
|
5076
|
+
|
5077
|
+
# Show exact values on wedges if show_value is True
|
5078
|
+
if show_value:
|
5079
|
+
for i, (wedge, txt) in enumerate(zip(wedges, texts)):
|
5080
|
+
angle = (wedge.theta2 - wedge.theta1) / 2 + wedge.theta1
|
5081
|
+
x = np.cos(np.radians(angle)) * (pctdistance ) * radius_
|
5082
|
+
y = np.sin(np.radians(angle)) * (pctdistance ) * radius_
|
5083
|
+
if not fmt.startswith("{"):
|
5084
|
+
value_text = f"{sizes[i]:{fmt}}"
|
5085
|
+
else:
|
5086
|
+
value_text = fmt.format(sizes[i])
|
5087
|
+
ax.text(x, y, value_text, ha="center", va="center", fontsize=fontsize,color=fontcolor)
|
5088
|
+
inested+=1
|
5089
|
+
# Customize the legend
|
5090
|
+
if show_legend:
|
5091
|
+
ax.legend(
|
5092
|
+
wedges,
|
5093
|
+
labels_legend,
|
5094
|
+
loc=legend_loc,
|
5095
|
+
bbox_to_anchor=bbox_to_anchor,
|
5096
|
+
fontsize=legend_fontsize,
|
5097
|
+
title_fontsize=legend_fontsize,
|
5098
|
+
)
|
5099
|
+
ax.set(aspect="equal")
|
5100
|
+
return ax
|
@@ -1,4 +1,5 @@
|
|
1
|
-
py2ls/.DS_Store,sha256=
|
1
|
+
py2ls/.DS_Store,sha256=oYc2FymKt-7YrKA0lByULr7fbLJkevemm_OHjyFjAvE,6148
|
2
|
+
py2ls/.git/.DS_Store,sha256=_QMqSMvFkiuSTudJbBnYTcETf3zOthZjrcI8LJ48tDA,6148
|
2
3
|
py2ls/.git/COMMIT_EDITMSG,sha256=AdtqRHle5Ej2EBNPJY79v-SB454v5UK4wuPCPFELiFQ,11
|
3
4
|
py2ls/.git/FETCH_HEAD,sha256=VM-2Jiw6iPaGu0ftg9xwq76OyNPWV0iT1nL0VWiL1zI,100
|
4
5
|
py2ls/.git/HEAD,sha256=KNJb-Cr0wOK3L1CVmyvrhZ4-YLljCl6MYD2tTdsrboA,21
|
@@ -17,12 +18,13 @@ py2ls/.git/hooks/pre-receive.sample,sha256=pMPSuce7P9jRRBwxvU7nGlldZrRPz0ndsxAlI
|
|
17
18
|
py2ls/.git/hooks/prepare-commit-msg.sample,sha256=6d3KpBif3dJe2X_Ix4nsp7bKFjkLI5KuMnbwyOGqRhk,1492
|
18
19
|
py2ls/.git/hooks/push-to-checkout.sample,sha256=pT0HQXmLKHxt16-mSu5HPzBeZdP0lGO7nXQI7DsSv18,2783
|
19
20
|
py2ls/.git/hooks/update.sample,sha256=jV8vqD4QPPCLV-qmdSHfkZT0XL28s32lKtWGCXoU0QY,3650
|
20
|
-
py2ls/.git/index,sha256=
|
21
|
+
py2ls/.git/index,sha256=W0gAn4tn97ChfLYb6Wsl7Pg4WPz0MrQl9TtSf6yagGw,4232
|
21
22
|
py2ls/.git/info/exclude,sha256=ZnH-g7egfIky7okWTR8nk7IxgFjri5jcXAbuClo7DsE,240
|
22
23
|
py2ls/.git/logs/HEAD,sha256=8ID7WuAe_TlO9g-ARxhIJYdgdL3u3m7-1qrOanaIUlA,3535
|
23
24
|
py2ls/.git/logs/refs/heads/main,sha256=8ID7WuAe_TlO9g-ARxhIJYdgdL3u3m7-1qrOanaIUlA,3535
|
24
25
|
py2ls/.git/logs/refs/remotes/origin/HEAD,sha256=58xXc_oi3Gt_mWRW_ZF3IES40amGtFS1N_I8J7E85Cw,23540
|
25
26
|
py2ls/.git/logs/refs/remotes/origin/main,sha256=9ohHV9XT1dBowBZUVo52U9205_o513hmvCvtW9rS4Fk,3192
|
27
|
+
py2ls/.git/objects/.DS_Store,sha256=p_UeT5XAI5c6cGAz23lbqMNMljXKR5ddgXEXeYDk4nk,18436
|
26
28
|
py2ls/.git/objects/01/d5bd8065e6860c0bd23ff9fa57161806a099e1,sha256=hEQ8nqJnGsfFsuV5wc4cZas58rehXvT0v5ANx1zmMAY,584
|
27
29
|
py2ls/.git/objects/09/08da26de58c114225ad81f484b80bf5d351b34,sha256=NOyYvrJxATpK3aDdP1_stwkqOQRDwJn7DSy6isyKImE,925
|
28
30
|
py2ls/.git/objects/0b/409e1bc918277010f5679b402d1d1dda53e15c,sha256=y5S1XaGxJz1NXi-SPWjPC_NKIqqSbZv9oOg74MzBihY,156
|
@@ -164,6 +166,7 @@ py2ls/.git/objects/f7/c98ba5c2f903e603b1f5e63d49fbc8a43815cc,sha256=tYbi3A7irrIP
|
|
164
166
|
py2ls/.git/objects/f9/045a08e96eb76848fc4d68e3e3e687cca39a2d,sha256=u29Cwu3SL3HlagZIal5ueGZ3miqgZAtuDbtP8-fUVvE,141
|
165
167
|
py2ls/.git/objects/fa/147e6bb78a2e8db241d231295fd7f1ed061af8,sha256=G9pg5LXv7AdxnPIQsTm2AF3Un314dLRJQYwxmZem9rQ,574
|
166
168
|
py2ls/.git/objects/fc/292e793ecfd42240ac43be407023bd731fa9e7,sha256=hGIYoxKWNT3IPwk3DE4l3FLBbUYF-kXcHcx7KrH9uS0,1971
|
169
|
+
py2ls/.git/refs/.DS_Store,sha256=L7IgUX7Va5Ta5UX5gavNXI5FGYpYxZ4Ie-wpMJR31fk,6148
|
167
170
|
py2ls/.git/refs/heads/main,sha256=vaWoJWq2YOJm04yq8v-ImmaNjjqq-OEhS8SdTKUuKw8,41
|
168
171
|
py2ls/.git/refs/remotes/origin/HEAD,sha256=K7aiSqD8bEhBAPXVGim7rYQc0sdV9dk_qiBOXbtOsrQ,30
|
169
172
|
py2ls/.git/refs/remotes/origin/main,sha256=vaWoJWq2YOJm04yq8v-ImmaNjjqq-OEhS8SdTKUuKw8,41
|
@@ -177,14 +180,14 @@ py2ls/bio.py,sha256=ET2J1DsDF_g6v1LIfmAXIfKa6Q7Gprh1g2f9ETnIamo,87529
|
|
177
180
|
py2ls/brain_atlas.py,sha256=w1o5EelRjq89zuFJUNSz4Da8HnTCwAwDAZ4NU4a-bAY,5486
|
178
181
|
py2ls/chat.py,sha256=Yr22GoIvoWhpV3m4fdwV_I0Mn77La346_ymSinR-ORA,3793
|
179
182
|
py2ls/correlators.py,sha256=RbOaJIPLCHJtUm5SFi_4dCJ7VFUPWR0PErfK3K26ad4,18243
|
180
|
-
py2ls/data/.DS_Store,sha256=
|
183
|
+
py2ls/data/.DS_Store,sha256=oKUet6ILEEdePWxBwhaml9DGq1V3bKz2PXqgnuo3-20,6148
|
181
184
|
py2ls/data/db2ls_sql_chtsht.json,sha256=ls9d7Sm8TLeujanWHfHlWhU85Qz1KnAizO_9X3wUH7E,6933
|
182
185
|
py2ls/data/docs_links.json,sha256=kXgbbWo0b8bfV4n6iuuUNLnZipIyLzokUO6Lzmf7nO4,101829
|
183
186
|
py2ls/data/email/email_html_template.html,sha256=UIg3aixWfdNsvVx-j2dX1M5N3G-6DgrnV1Ya1cLjiUQ,2809
|
184
187
|
py2ls/data/lang_code_iso639.json,sha256=qZiU7H2RLJjDMXK22C-jhwzLJCI5vKmampjB1ys4ek4,2157
|
185
188
|
py2ls/data/mygenes_fields_241022.txt,sha256=-7htEdtmqbSRTUKHHVmjUFLBwZZg9u3LFpn9OZMb1qg,11348
|
186
189
|
py2ls/data/sns_info.json,sha256=pEzdg2bhMkwQHZpXx02_7zAP7NvRoCc0Le8PN6Uv0Vk,4074
|
187
|
-
py2ls/data/styles/.DS_Store,sha256=
|
190
|
+
py2ls/data/styles/.DS_Store,sha256=JaPmqeoqbAR-2kNwkD6qbnKqwrahZvQ3CL_Uq6hv-ck,6148
|
188
191
|
py2ls/data/styles/example/style1.pdf,sha256=Pt_qQJ5kiCSIPiz3TWSwEffHUdj75kKXnZ4MPqpEx4I,29873
|
189
192
|
py2ls/data/styles/example/style2.pdf,sha256=0xduPLPulET38LEP2V2H_q70wqlrrBEo8ttqO-FMrfQ,25449
|
190
193
|
py2ls/data/styles/example/style3.pdf,sha256=010-Pm2BUowAt0XDkJWZTR5rAszLqmI1DO3209sIFWs,65536
|
@@ -230,22 +233,23 @@ py2ls/data/usages_pd.json,sha256=4DgbPahF4G5Hd6G0TQurb6dBRVey67lpKdgK6A01Tww,266
|
|
230
233
|
py2ls/data/usages_sns.json,sha256=rZ2uxBFhQr0UzvuPZMIF3ngQRFRZDAjgmI-0TNRFcdU,9620
|
231
234
|
py2ls/db2ls.py,sha256=MMfFX47aIPIyu7fU9aPvX9lbPRPYOpJ_VXwlnWk-8qo,13615
|
232
235
|
py2ls/doc.py,sha256=xN3g1OWfoaGUhikbJ0NqbN5eKy1VZVvWwRlhHMgyVEc,4243
|
236
|
+
py2ls/ec2ls.py,sha256=PyLkiWYB8AJTIGdMn6VrEoE2vFtPYxt4WrCJfGQPFDk,2271
|
233
237
|
py2ls/export_requirements.py,sha256=x2WgUF0jYKz9GfA1MVKN-MdsM-oQ8yUeC6Ua8oCymio,2325
|
234
238
|
py2ls/fetch_update.py,sha256=9LXj661GpCEFII2wx_99aINYctDiHni6DOruDs_fdt8,4752
|
235
239
|
py2ls/freqanalysis.py,sha256=F4218VSPbgL5tnngh6xNCYuNnfR-F_QjECUUxrPYZss,32594
|
236
240
|
py2ls/ich2ls.py,sha256=3E9R8oVpyYZXH5PiIQgT3CN5NxLe4Dwtm2LwaeacE6I,21381
|
237
|
-
py2ls/ips.py,sha256=
|
238
|
-
py2ls/ml2ls
|
239
|
-
py2ls/ml2ls.py,sha256=1pN6nACn5XEKuipg-44EWSn5QlZ9q6Kzx6uMCdqQiBo,146129
|
241
|
+
py2ls/ips.py,sha256=6DgsZw6Z6u3_Y8FtMyO6NpddWiz90juy_ZSoY5rjtjI,303872
|
242
|
+
py2ls/ml2ls.py,sha256=fp7zIZX-SMLYIBF5q8pqM9ekJh1R8jCfyGgA8YUMJlw,184553
|
240
243
|
py2ls/mol.py,sha256=AZnHzarIk_MjueKdChqn1V6e4tUle3X1NnHSFA6n3Nw,10645
|
241
244
|
py2ls/netfinder.py,sha256=R70NkrnO8LlXjT1y7bf2TN-yE4yOeAYhb0jDBiNp8XA,57536
|
245
|
+
py2ls/nl2ls.py,sha256=UEIdok-OamFZFIvvz_PdZenu085zteMdaJd9mLu3F-s,11485
|
242
246
|
py2ls/ocr.py,sha256=5lhUbJufIKRSOL6wAWVLEo8TqMYSjoI_Q-IO-_4u3DE,31419
|
243
|
-
py2ls/plot.py,sha256=
|
247
|
+
py2ls/plot.py,sha256=NpQDc31GyWygkDEkBMl7q6D8VSfHtXeUwDUTOUAe6Vc,200060
|
244
248
|
py2ls/setuptools-70.1.0-py3-none-any.whl,sha256=2bi3cUVal8ip86s0SOvgspteEF8SKLukECi-EWmFomc,882588
|
245
249
|
py2ls/sleep_events_detectors.py,sha256=bQA3HJqv5qnYKJJEIhCyhlDtkXQfIzqksnD0YRXso68,52145
|
246
250
|
py2ls/stats.py,sha256=qBn2rJmNa_QLLUqjwYqXUlGzqmW94sgA1bxJU2FC3r0,39175
|
247
251
|
py2ls/translator.py,sha256=77Tp_GjmiiwFbEIJD_q3VYpQ43XL9ZeJo6Mhl44mvh8,34284
|
248
252
|
py2ls/wb_detector.py,sha256=7y6TmBUj9exCZeIgBAJ_9hwuhkDh1x_-yg4dvNY1_GQ,6284
|
249
|
-
py2ls-0.2.4.
|
250
|
-
py2ls-0.2.4.
|
251
|
-
py2ls-0.2.4.
|
253
|
+
py2ls-0.2.4.25.dist-info/METADATA,sha256=R29MJjrb1zGlKMcACwV_XEOGL0EBYjVADtlYo5kG0Kw,20078
|
254
|
+
py2ls-0.2.4.25.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
|
255
|
+
py2ls-0.2.4.25.dist-info/RECORD,,
|