Skip to content

Commit

Permalink
new plot
Browse files Browse the repository at this point in the history
  • Loading branch information
duan committed Oct 31, 2023
1 parent 6f52180 commit dafc463
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion npmi_heatmap_sentence.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion npmi_heatmap_text.html

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions pmi.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import numpy as np
import plotly.graph_objects as go


df = pd.read_csv("work_title.tsv", sep="\t")
df = df[df.type == "Literary work"]
#remove the rows where identifier is empty
Expand Down Expand Up @@ -71,13 +70,14 @@
colorscale=custom_colorscale,
zmin=-1, # Assuming the NPMI values range from -1 to 1
zmax=1,
colorbar=dict(tickvals=[0], ticktext=['No Cooccurrence'])))
colorbar=dict(ticktext=['No Cooccurrence'])
))

# Update layout to make it more readable
fig.update_layout(
title=f'NPMI Heatmap of Works (cooccurrence in {umfang})',
xaxis_nticks=36,
yaxis_nticks=36,
xaxis_nticks=100,
yaxis_nticks=100,
xaxis_title="Work 1",
yaxis_title="Work 2",
margin=dict(l=150, r=5, t=45, b=120)
Expand Down

0 comments on commit dafc463

Please sign in to comment.