Skip to content

Commit

Permalink
v0.2.13
Browse files Browse the repository at this point in the history
  • Loading branch information
yh202109 committed Jul 3, 2024
1 parent bcab00f commit 1e154c1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# Changelog

<!--next-version-placeholder-->
## v0.2.12 (2024-07-03)
## v0.2.13 (2024-07-03)

- add Fleiss's kappa variance
- add Kendall's tau algorithm
- add Cohen's kappa bubble plot
- add Cohen's kappa bubble plot with hist
- adjust y-axis order of Cohen's kappa bubble plot with hist

## v0.2.11 (2024-06-18)

Expand Down
7 changes: 5 additions & 2 deletions mtbp3/statlab/kappa.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,15 +278,18 @@ def create_bubble_plot(self, out_path="", axis_label=[], max_size_ratio=0, hist=
r2.append(c2)
sizes.append(self.y_count_sq.iloc[i1, i2])
df0 = pd.DataFrame({'r1': r1, 'r2': r2, 'sizes': sizes})
df0['r1'] = pd.Categorical(df0['r1'])
df0['r2'] = pd.Categorical(df0['r2'])
max_size_ratio = max_size_ratio if max_size_ratio >= 1 else max(1,int((6000/max(sizes)) / n_categories))
if hist:
sns.jointplot(
data=df0, x="r1", y="r2", kind="scatter",
height=5, ratio=3, marginal_ticks=True,
marginal_kws={"weights": sizes, "shrink":.5},
marginal_kws={"weights": sizes, "shrink":.5, "legend": False},
joint_kws={"size": sizes, "legend": False, "sizes":(min(sizes), max(sizes)*max_size_ratio)}
)
#sns.jointplot(data=df0, x="r1", y="r2", size="sizes", kind="scatter")
tmp1 = plt.ylim()
plt.ylim(tmp1[1], tmp1[0])
else:
sns.scatterplot(data=df0, x="r1", y="r2", size="sizes", sizes=(min(sizes), max(sizes)*max_size_ratio), legend=False)
tmp1 = plt.xlim()
Expand Down

0 comments on commit 1e154c1

Please sign in to comment.