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 1
1
import json
2
2
from datetime import date
3
-
3
+ import urllib .request
4
+ import matplotlib .pyplot as plt
4
5
import humanize
5
6
import matplotlib .pyplot as plt
6
7
import pandas as pd
14
15
import squarify
15
16
16
17
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
+
17
37
def get_random_sample (df ):
18
38
"""
19
39
Returns a random sample from the dataframe from a dataset with non-zero score.
@@ -826,7 +846,7 @@ def get_projects_treemap(df):
826
846
squarify .plot (sizes_list )
827
847
828
848
filename = f'treemap-projects-{ datetime .now ().strftime ("%Y%m%d" )} .png'
829
- plt .savefig ("path/to/save/plot.png" )
849
+ plt .savefig (filename )
830
850
831
851
832
852
def __get__percentage_of_metadata_version_1 (df ):
You can’t perform that action at this time.
0 commit comments