diff --git a/classes/DataSet_Visualizer.py b/classes/DataSet_Visualizer.py index ded5a57..0f8fe08 100644 --- a/classes/DataSet_Visualizer.py +++ b/classes/DataSet_Visualizer.py @@ -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')