Update DataSet_Visualizer.py

This commit is contained in:
daxcay
2024-10-18 22:47:50 +05:30
parent 1ae12d7009
commit fc37913194
+9 -1
View File
@@ -91,7 +91,11 @@ def generate_wordcloud_and_network_graph(contents, separator, top_n_wordcloud=10
tag_freq_table.reset_index(inplace=True)
tag_freq_table.columns = ['Tag', 'Frequency']
plt.figure(figsize=(12, 6))
print("--------------------------------------------------------------------")
table_height = max(6, 0.4 * len(tag_freq_table))
plt.figure(figsize=(12, table_height))
bars = plt.bar(tag_freq_table['Tag'][:top_n_table], tag_freq_table['Frequency'][:top_n_table], color='skyblue')
for bar in bars:
@@ -101,6 +105,10 @@ def generate_wordcloud_and_network_graph(contents, separator, top_n_wordcloud=10
plt.xlabel('Tag')
plt.ylabel('Frequency')
plt.xticks(rotation=45, ha='right')
plt.margins(x=0.1)
plt.subplots_adjust(bottom=0.2)
plt.tight_layout()
output_table_file = join(output_dir, 'tag_frequency_table.png')