File size: 405 Bytes
f6f422c
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14

import matplotlib.pyplot as plt

def plot_trends(data):
    models = [item['model'] for item in data]
    prices = [float(item['price'].replace('₴', '').strip()) for item in data]
    plt.plot(models, prices, marker='o', color='b')
    plt.title('Price Trends of Products')
    plt.xlabel('Models')
    plt.ylabel('Price')
    plt.xticks(rotation=45)
    plt.tight_layout()
    return plt