File tree Expand file tree Collapse file tree 1 file changed +22
-2
lines changed
Expand file tree Collapse file tree 1 file changed +22
-2
lines changed Original file line number Diff line number Diff line change 11import json
22from datetime import date
3-
3+ import urllib .request
4+ import matplotlib .pyplot as plt
45import humanize
56import matplotlib .pyplot as plt
67import pandas as pd
1415import squarify
1516
1617
18+ def __get_general_modality_plot (df ):
19+ modality_counts = df ["generalmodality" ].value_counts ()
20+
21+ plt .figure (figsize = (10 , 6 ))
22+ color = plt .cm .tab20c .colors
23+
24+ ax = modality_counts .plot (kind = "bar" , color = color , edgecolor = "black" )
25+ plt .xlabel ("General Modality" , fontsize = 12 )
26+ plt .ylabel ("Frequency" , fontsize = 12 )
27+ plt .title ("Frequency of General Modality" , fontsize = 14 )
28+ plt .xticks (rotation = 45 , ha = "right" , fontsize = 10 )
29+ plt .yticks (fontsize = 10 )
30+
31+ plt .tight_layout ()
32+
33+ filename = f'general-modality-{ datetime .now ().strftime ("%Y%m%d" )} .png'
34+ plt .savefig (filename )
35+
36+
1737def get_random_sample (df ):
1838 """
1939 Returns a random sample from the dataframe from a dataset with non-zero score.
@@ -826,7 +846,7 @@ def get_projects_treemap(df):
826846 squarify .plot (sizes_list )
827847
828848 filename = f'treemap-projects-{ datetime .now ().strftime ("%Y%m%d" )} .png'
829- plt .savefig ("path/to/save/plot.png" )
849+ plt .savefig (filename )
830850
831851
832852def __get__percentage_of_metadata_version_1 (df ):
You can’t perform that action at this time.
0 commit comments