ℹ️ Skipped - page is already crawled
| Filter | Status | Condition | Details |
|---|---|---|---|
| HTTP status | PASS | download_http_code = 200 | HTTP 200 |
| Age cutoff | PASS | download_stamp > now() - 6 MONTH | 0 months ago |
| History drop | PASS | isNull(history_drop_reason) | No drop reason |
| Spam/ban | PASS | fh_dont_index != 1 AND ml_spam_score = 0 | ml_spam_score=0 |
| Canonical | PASS | meta_canonical IS NULL OR = '' OR = src_unparsed | Not set |
| Property | Value |
|---|---|
| URL | https://www.statology.org/seaborn-time-series/ |
| Last Crawled | 2026-04-11 12:58:13 (1 day ago) |
| First Indexed | 2021-08-05 13:40:41 (4 years ago) |
| HTTP Status Code | 200 |
| Meta Title | How to Create a Time Series Plot in Seaborn |
| Meta Description | This tutorial explains how to create a time series plot in seaborn, including several examples. |
| Meta Canonical | null |
| Boilerpipe Text | A
time series plot
is useful for visualizing data values that change over time.
This tutorial explains how to create various time series plots using the
seaborn
data visualization package in Python.
Example 1: Plot a Single Time Series
The following code shows how to plot a single time series in seaborn:
import
pandas
as
pd
import
matplotlib.
pyplot
as
plt
import
seaborn
as
sns
#create DataFrame
df = pd.
DataFrame
({'
date
': ['1/2/2021',
'1/3/2021',
'1/4/2021',
'1/5/2021',
'1/6/2021',
'1/7/2021',
'1/8/2021'],
'
value
': [4, 7, 8, 13, 17, 15, 21]})
sns.
lineplot
(x='
date
', y='
value
', data=df)
Note that we can also customize the colors, line width, line style, labels, and titles of the plot:
#create time series plot with custom
aesthetics
sns.
lineplot
(x='
date
', y='
value
', data=df, linewidth=
3
, color='
purple
',
linestyle='
dashed
').
set
(title='
Time Series Plot
')
#rotate x-axis labels by 15 degrees
plt.
xticks
(rotation=
15
)
Example 2: Plot Multiple Time Series
The following code shows how to plot multiple time series in seaborn:
import
pandas
as
pd
import
matplotlib.
pyplot
as
plt
import
seaborn
as
sns
#create DataFrame
df = pd.
DataFrame
({'
date
': ['1/1/2021',
'1/2/2021',
'1/3/2021',
'1/4/2021',
'1/1/2021',
'1/2/2021',
'1/3/2021',
'1/4/2021'],
'
sales
': [4, 7, 8, 13, 17, 15, 21, 28],
'
company
': ['A', 'A', 'A', 'A', 'B', 'B', 'B', 'B']})
#plot multiple time series
sns.
lineplot
(x='
date
', y='
sales
', hue='
company
', data=df)
Note that the
hue
argument is used to provide different colors to each line in the plot.
Additional Resources
The following tutorials explain how to perform other common functions in seaborn:
How to Add a Title to Seaborn Plots
How to Change Legend Font Size in Seaborn
How to Change the Position of a Legend in Seaborn
Hey there. My name is Zach Bobbitt. I have a Masters of Science degree in Applied Statistics and I’ve worked on machine learning algorithms for professional businesses in both healthcare and retail. I’m passionate about statistics, machine learning, and data visualization and I created Statology to be a resource for both students and teachers alike. My goal with this site is to help you learn statistics through using simple terms, plenty of real-world examples, and helpful illustrations. |
| Markdown | [](https://www.statology.org/)
- [About](https://www.statology.org/about/)
- [Course](https://www.statology.org/course-register/)
- [Basic Stats](https://www.statology.org/tutorials/)
- [Machine Learning](https://www.statology.org/machine-learning-tutorials/)
- [Software Tutorials]()
- [Excel](https://www.statology.org/excel-guides/)
- [Google Sheets](https://www.statology.org/google-sheets-guides/)
- [MongoDB](https://www.statology.org/mongodb-guides/)
- [MySQL](https://www.statology.org/mysql-guides/)
- [Power BI](https://www.statology.org/power-bi-guides/)
- [PySpark](https://www.statology.org/pyspark-guides/)
- [Python](https://www.statology.org/python-guides/)
- [R](https://www.statology.org/r-guides/)
- [SAS](https://www.statology.org/sas-guides/)
- [SPSS](https://www.statology.org/spss-guides/)
- [Stata](https://www.statology.org/stata-guides/)
- [TI-84](https://www.statology.org/ti-84-guides/)
- [VBA](https://www.statology.org/vba-guides/)
- [Tools]()
- [Calculators](https://www.statology.org/calculators/)
- [Critical Value Tables](https://www.statology.org/tables/)
- [Glossary](https://www.statology.org/glossary/)
# How to Create a Time Series Plot in Seaborn
by [Zach Bobbitt](https://www.statology.org/author/admin/)
Published on
[Published on August 5, 2021](https://www.statology.org/seaborn-time-series/)
***
A **time series plot** is useful for visualizing data values that change over time.
This tutorial explains how to create various time series plots using the [seaborn](https://seaborn.pydata.org/) data visualization package in Python.
### **Example 1: Plot a Single Time Series**
The following code shows how to plot a single time series in seaborn:
```
import pandas as pd import matplotlib.pyplot as plt import seaborn as sns #create DataFrame df = pd.DataFrame({'date': ['1/2/2021', '1/3/2021', '1/4/2021', '1/5/2021', '1/6/2021', '1/7/2021', '1/8/2021'], 'value': [4, 7, 8, 13, 17, 15, 21]}) sns.lineplot(x='date', y='value', data=df)
```

Note that we can also customize the colors, line width, line style, labels, and titles of the plot:
```
#create time series plot with custom aesthetics sns.lineplot(x='date', y='value', data=df, linewidth=3, color='purple', linestyle='dashed').set(title='Time Series Plot') #rotate x-axis labels by 15 degrees plt.xticks(rotation=15)
```

### **Example 2: Plot Multiple Time Series**
The following code shows how to plot multiple time series in seaborn:
```
import pandas as pd import matplotlib.pyplot as plt import seaborn as sns #create DataFrame df = pd.DataFrame({'date': ['1/1/2021', '1/2/2021', '1/3/2021', '1/4/2021', '1/1/2021', '1/2/2021', '1/3/2021', '1/4/2021'], 'sales': [4, 7, 8, 13, 17, 15, 21, 28], 'company': ['A', 'A', 'A', 'A', 'B', 'B', 'B', 'B']}) #plot multiple time series sns.lineplot(x='date', y='sales', hue='company', data=df)
```

Note that the **hue** argument is used to provide different colors to each line in the plot.
### **Additional Resources**
The following tutorials explain how to perform other common functions in seaborn:
[How to Add a Title to Seaborn Plots](https://www.statology.org/seaborn-title/)
[How to Change Legend Font Size in Seaborn](https://www.statology.org/seaborn-legend-size/)
[How to Change the Position of a Legend in Seaborn](https://www.statology.org/seaborn-legend-position/)
Posted in [Programming](https://www.statology.org/category/programming/)

[Zach Bobbitt](https://www.statology.org/author/admin/)
Hey there. My name is Zach Bobbitt. I have a Masters of Science degree in Applied Statistics and I’ve worked on machine learning algorithms for professional businesses in both healthcare and retail. I’m passionate about statistics, machine learning, and data visualization and I created Statology to be a resource for both students and teachers alike. My goal with this site is to help you learn statistics through using simple terms, plenty of real-world examples, and helpful illustrations.
## Post navigation
[Prev When Should You Use Correlation? (Explanation & Examples)](https://www.statology.org/when-to-use-correlation/)
[Next 5 Examples of Time Series Analysis in Real Life](https://www.statology.org/time-series-analysis-real-life-examples/)
### Leave a Reply [Cancel reply](https://www.statology.org/seaborn-time-series/#respond)
## Search
## ABOUT STATOLOGY
[](https://www.statology.org/about/)Statology makes learning statistics easy by explaining topics in simple and straightforward ways. Our team of writers have over 40 years of experience in the fields of Machine Learning, AI and Statistics. **[Learn more about our team here.](https://www.statology.org/about/)**
## Featured Posts
- [](https://www.statology.org/choosing-the-right-distance-metric-for-clustering-a-decision-tree-approach/)
[Choosing the Right Distance Metric for Clustering: A Decision Tree Approach](https://www.statology.org/choosing-the-right-distance-metric-for-clustering-a-decision-tree-approach/)
April 10, 2026
- [](https://www.statology.org/how-to-analyze-word-frequencies-with-textblob-in-python/)
[How to Analyze Word Frequencies with TextBlob in Python](https://www.statology.org/how-to-analyze-word-frequencies-with-textblob-in-python/)
April 9, 2026
- [](https://www.statology.org/from-raw-data-to-insight-with-copilot-across-the-microsoft-stack/)
[From Raw Data to Insight with Copilot Across the Microsoft Stack](https://www.statology.org/from-raw-data-to-insight-with-copilot-across-the-microsoft-stack/)
April 9, 2026
- [](https://www.statology.org/how-to-measure-subjectivity-in-text-with-textblob-in-python/)
[How to Measure Subjectivity in Text with TextBlob in Python](https://www.statology.org/how-to-measure-subjectivity-in-text-with-textblob-in-python/)
April 8, 2026
- [](https://www.statology.org/how-to-calculate-sentiment-polarity-scores-with-textblob-in-python/)
[How to Calculate Sentiment Polarity Scores with TextBlob in Python](https://www.statology.org/how-to-calculate-sentiment-polarity-scores-with-textblob-in-python/)
April 7, 2026
- [](https://www.statology.org/getting-started-with-textblob-in-python/)
[Getting Started with TextBlob in Python](https://www.statology.org/getting-started-with-textblob-in-python/)
April 7, 2026
## Statology Study
**[Statology Study](https://www.statology.org/study-register/)** is the ultimate online statistics study guide that helps you study and practice all of the core concepts taught in any elementary statistics course and makes your life so much easier as a student.
[](https://www.statology.org/study-register/)
## Introduction to Statistics Course
**Introduction to Statistics** is our premier online video course that teaches you all of the topics covered in introductory statistics. **[Get started](https://www.statology.org/course-register/)** with our course today.
[](https://www.statology.org/course-register/)
## You Might Also Like
- [How to Change Font Size in Seaborn Plots (With Examples)](https://www.statology.org/seaborn-font-size/)
- [How to Create a Grouped Bar Plot in Seaborn (Step-by-Step)](https://www.statology.org/seaborn-grouped-bar-plot/)
- [How to Create an Area Chart in Seaborn (With Examples)](https://www.statology.org/seaborn-area-chart/)
- [How to Create a Stacked Bar Plot in Seaborn (Step-by-Step)](https://www.statology.org/seaborn-stacked-bar-plot/)
- [How to Plot a Time Series in Matplotlib (With Examples)](https://www.statology.org/matplotlib-time-series/)
- [Seaborn: How to Create a Boxplot of Multiple Columns](https://www.statology.org/seaborn-boxplot-multiple-columns/)
© 2025 [Statology](https://www.statology.org/) \| [Privacy Policy](https://www.guidingtechmedia.com/privacy/) \| [Terms of Use](https://www.guidingtechmedia.com/terms-of-use/)
Wisteria Theme by [WPFriendship](https://wpfriendship.com/ "WPFriendship") ⋅ Powered by [WordPress](https://wordpress.org/ "WordPress") |
| Readable Markdown | ***
A **time series plot** is useful for visualizing data values that change over time.
This tutorial explains how to create various time series plots using the [seaborn](https://seaborn.pydata.org/) data visualization package in Python.
### **Example 1: Plot a Single Time Series**
The following code shows how to plot a single time series in seaborn:
```
import pandas as pd import matplotlib.pyplot as plt import seaborn as sns #create DataFrame df = pd.DataFrame({'date': ['1/2/2021', '1/3/2021', '1/4/2021', '1/5/2021', '1/6/2021', '1/7/2021', '1/8/2021'], 'value': [4, 7, 8, 13, 17, 15, 21]}) sns.lineplot(x='date', y='value', data=df)
```

Note that we can also customize the colors, line width, line style, labels, and titles of the plot:
```
#create time series plot with custom aesthetics sns.lineplot(x='date', y='value', data=df, linewidth=3, color='purple', linestyle='dashed').set(title='Time Series Plot') #rotate x-axis labels by 15 degrees plt.xticks(rotation=15)
```

### **Example 2: Plot Multiple Time Series**
The following code shows how to plot multiple time series in seaborn:
```
import pandas as pd import matplotlib.pyplot as plt import seaborn as sns #create DataFrame df = pd.DataFrame({'date': ['1/1/2021', '1/2/2021', '1/3/2021', '1/4/2021', '1/1/2021', '1/2/2021', '1/3/2021', '1/4/2021'], 'sales': [4, 7, 8, 13, 17, 15, 21, 28], 'company': ['A', 'A', 'A', 'A', 'B', 'B', 'B', 'B']}) #plot multiple time series sns.lineplot(x='date', y='sales', hue='company', data=df)
```

Note that the **hue** argument is used to provide different colors to each line in the plot.
### **Additional Resources**
The following tutorials explain how to perform other common functions in seaborn:
[How to Add a Title to Seaborn Plots](https://www.statology.org/seaborn-title/)
[How to Change Legend Font Size in Seaborn](https://www.statology.org/seaborn-legend-size/)
[How to Change the Position of a Legend in Seaborn](https://www.statology.org/seaborn-legend-position/)

Hey there. My name is Zach Bobbitt. I have a Masters of Science degree in Applied Statistics and I’ve worked on machine learning algorithms for professional businesses in both healthcare and retail. I’m passionate about statistics, machine learning, and data visualization and I created Statology to be a resource for both students and teachers alike. My goal with this site is to help you learn statistics through using simple terms, plenty of real-world examples, and helpful illustrations. |
| Shard | 80 (laksa) |
| Root Hash | 6121278954233998080 |
| Unparsed URL | org,statology!www,/seaborn-time-series/ s443 |