title: Generating a Line Graph using Seaborn or Matplotlib with: Year as hue, Month as X-Axis and Float Column as Y-Axis
body: <p>The problem is I'm trying to generate a line graph using seaborn.lineplot() function, but I can't seem to find a way to generate a line graph like the one below:</p>
  <p><a href="https://i.stack.imgur.com/zUKog.png" rel="nofollow noreferrer">https://i.stack.imgur.com/zUKog.png</a></p>
  <p>My dataset has the following columns: Year, Month, Day, Units, Price per Unit, Sales.
  I've used the groupby function from pandas to sum the sales for each year in each month.</p>
  <pre><code>import pandas as pd
  import numpy as np
  import matplotlib.pyplot as plt
  import seaborn as sns
  
  years_list = [date.strftime('%Y/%#-m/%#-d') for date in pd.date_range('01/01/2000', '31/12/2019')]
  
  data = {
      'year': [int(date.split('/')[0]) for date in years_list],
      'month': [int(date.split('/')[1]) for date in years_list],
      'day': [int(date.split('/')[2]) for date in years_list],
      'units': [np.random.randint(1,25) for turns in range(len(years_list))],
      'price_per_unit': [np.random.uniform(10, 100) for turns in range(len(years_list))]
  }
  
  df = pd.DataFrame(data)
  df['sales'] = df['price_per_unit'] * df['units']
  each_month = df.groupby(['year', 'month'])['sales'].sum().reset_index()
  </code></pre>
  <p>Initially, I thought that using the code <code>sns.lineplot(x='month', y='sales', hue='year', data=each_month)</code> would automatically generate my desired graph, but it generated a confusing graph instead.</p>
  <p>Anyone who has a solution for me? even if it isn't by using seaborn but matplotlib.</p>