Untitled
unknown
plain_text
a year ago
2.9 kB
5
Indexable
# Let's try generating the plots again import matplotlib.pyplot as plt import pandas as pd # Data for Text 1 move_structures_text1 = { 'Type': ['AREA', 'REVIEW', 'GAP', 'Purpose'], 'Frequency': [16, 13, 4, 1], 'Percentage': [47, 38, 12, 3] } hedging_types_text1 = { 'Type': ['Introductory verbs', 'Certain lexical verbs', 'Certain modal verbs', 'Adverbs of frequency', 'Modal adverbs', 'Modal adjectives', 'Modal nouns', 'That clauses', 'Adjective + to-clause', 'None of the above'], 'Frequency': [0, 3, 3, 0, 1, 0, 0, 1, 1, 25], 'Percentage': [0, 9, 9, 0, 3, 0, 0, 3, 3, 74] } # Data for Text 2 move_structures_text2 = { 'Type': ['AREA', 'REVIEW', 'GAP', 'Purpose'], 'Frequency': [0, 8, 4, 3], 'Percentage': [0, 53, 27, 20] } hedging_types_text2 = { 'Type': ['Introductory verbs', 'Certain lexical verbs', 'Certain modal verbs', 'Adverbs of frequency', 'Modal adverbs', 'Modal adjectives', 'Modal nouns', 'That clauses', 'Adjective + to-clause', 'None of the above'], 'Frequency': [1, 0, 0, 0, 0, 0, 1, 0, 0, 13], 'Percentage': [7, 0, 0, 0, 0, 0, 7, 0, 0, 87] } # Convert to DataFrames df_move_structures_text1 = pd.DataFrame(move_structures_text1) df_hedging_types_text1 = pd.DataFrame(hedging_types_text1) df_move_structures_text2 = pd.DataFrame(move_structures_text2) df_hedging_types_text2 = pd.DataFrame(hedging_types_text2) # Plot Move Structures for Text 1 plt.figure(figsize=(10, 6)) plt.bar(df_move_structures_text1['Type'], df_move_structures_text1['Frequency'], color='skyblue') plt.xlabel('Move Type') plt.ylabel('Frequency') plt.title('Frequency of Move Structures in Text 1') plt.savefig('/mnt/data/Move_Structures_Text1.png') plt.show() # Plot Hedging Types for Text 1 plt.figure(figsize=(12, 6)) plt.bar(df_hedging_types_text1['Type'], df_hedging_types_text1['Frequency'], color='lightgreen') plt.xlabel('Hedging Type') plt.ylabel('Frequency') plt.title('Frequency of Hedging Types in Text 1') plt.xticks(rotation=45, ha='right') plt.tight_layout() plt.savefig('/mnt/data/Hedging_Types_Text1.png') plt.show() # Plot Move Structures for Text 2 plt.figure(figsize=(10, 6)) plt.bar(df_move_structures_text2['Type'], df_move_structures_text2['Frequency'], color='salmon') plt.xlabel('Move Type') plt.ylabel('Frequency') plt.title('Frequency of Move Structures in Text 2') plt.savefig('/mnt/data/Move_Structures_Text2.png') plt.show() # Plot Hedging Types for Text 2 plt.figure(figsize=(12, 6)) plt.bar(df_hedging_types_text2['Type'], df_hedging_types_text2['Frequency'], color='orange') plt.xlabel('Hedging Type') plt.ylabel('Frequency') plt.title('Frequency of Hedging Types in Text 2') plt.xticks(rotation=45, ha='right') plt.tight_layout() plt.savefig('/mnt/data/Hedging_Types_Text2.png') plt.show()
Editor is loading...
Leave a Comment