'; var adpushup = adpushup || {}; adpushup.que = adpushup.que || []; adpushup.que.push(function() { adpushup.triggerAd(ad_id); });

To plot a time series graph using Seaborn or Plotly, we can take the following steps −

- Set the figure size and adjust the padding between and around the subplots.
- Create a Pandas dataframe, df, to hold a date_time series "time" and another variable data, speed.
- Make a Seaborn line plot with the data, "time" and "speed"
- Rotate the tick params by 45.
- To display the figure, use show() method.

## Example

import seaborn as snsfrom matplotlib import pyplot as pltimport pandas as pdimport numpy as npplt.rcParams["figure.figsize"] = [7.00, 3.50]plt.rcParams["figure.autolayout"] = Truedf = pd.DataFrame( dict( time=list(pd.date_range("2021-01-01 12:00:00", periods=10, freq="30min")), speed=np.linspace(1, 10, 10) ))ax = sns.lineplot(x="time", y="speed", data=df)ax.tick_params(rotation=45)plt.show()

## Output

It will produce the following output

Updated on: 22-Sep-2021

3K+ Views

- Related Articles
- How to plot two violin plot series on the same graph using Seaborn?
- Python - Create a Time Series Plot using Line Plot with Seaborn
- How to plot a time series in Python?
- How to plot multiple time series using ggplot2 in R?
- Plot multiple time-series DataFrames into a single plot using Pandas (Matplotlib)
- Python - Create a Time Series Plot with multiple columns using Line Plot
- How to Read PACF Graph for Time Series?
- How to create a time series plot in R without time vector?
- How to plot a bar graph in Matplotlib from a Pandas series?
- How to plot a non-square Seaborn jointplot or JointGrid? (Matplotlib)
- How to convert ggplot2 graph into a plotly graph in R?
- How to plot multiple histograms on same plot with Seaborn using Matplotlib?
- How do you plot a vertical line on a time series plot in Pandas?
- How to Make a Time Series Plot with Rolling Average in Python?
- How to remove or hide X-axis labels from a Seaborn / Matplotlib plot?

Advertisem*nts

';adpushup.triggerAd(ad_id); });