- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

# How to create a time series plot in R without time vector?

To create a time series plot in R without time vector, we can use ts.plot function.

For Example, if we have a vector called X then we can create the time series plot of X by using the command ts.plot(X), the Output of this command will have a time axis in place of X-axis. Check out the below Examples to understand how it works.

## Example 1

Consider the following vector −

x<-rnorm(10) ts.plot(x)

## Output

If you execute the above given snippet, it generates the following Output −

## Example 2

To create a time series plot in R without time vector, add the following code to the above snippet −

y<-rpois(10,5) ts.plot(y)

## Output

If you execute all the above given snippets as a single program, it generates the following Output −

- Related Questions & Answers
- How to create a vertical line in a time series plot in base R?
- How to convert a time series object to a vector in R?
- How to plot a time series in Python?
- How to plot multiple time series using ggplot2 in R?
- How to plot time series data with labels in R?
- Python - Create a Time Series Plot using Line Plot with Seaborn
- Python - Create a Time Series Plot with multiple columns using Line Plot
- Annotate Time Series plot in Matplotlib
- How to plot a time series graph using Seaborn or Plotly?
- How to create a plot in base R without margins?
- How do you plot a vertical line on a time series plot in Pandas?
- How to check if a time series is stationary in R?
- Plot multiple time-series DataFrames into a single plot using Pandas (Matplotlib)
- How to plot a time series array, with confidence intervals displayed in Python? (Matplotlib)
- How to create two 3d plots at a time in R?

Advertisements