Skip to content

Commit 8e22b26

Browse files
authored
General Modality Plot
1 parent 8f72097 commit 8e22b26

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

braininventory/get.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,25 @@
33
import json
44
from datetime import date
55

6-
6+
import urllib.request
7+
import matplotlib.pyplot as plt
8+
9+
def __get_general_modality_plot(df):
10+
modality_counts = df['generalmodality'].value_counts()
11+
12+
plt.figure(figsize=(10,6))
13+
color = plt.cm.tab20c.colors
14+
15+
ax = modality_counts.plot(kind='bar', color=color, edgecolor='black')
16+
plt.xlabel("General Modality", fontsize=12)
17+
plt.ylabel("Frequency", fontsize=12)
18+
plt.title("Frequency of General Modality", fontsize=14)
19+
plt.xticks(rotation=45, ha='right',fontsize=10)
20+
plt.yticks(fontsize=10)
21+
22+
plt.tight_layout()
23+
plt.show()
24+
725
def today():
826
"""
927
Get today's snapshot of Brain Image Library.

0 commit comments

Comments
 (0)