- Trending Categories
- Data Structure
- Operating System
- C Programming
- Social Studies
- Fashion Studies
- Legal Studies
- 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 plot in base R with dates sequence on X-axis?
If we have a vector that contains dates as sequence that needs to be plotted on the X-axis and another vector for the response then the plot can be simply created by using the plot function. In the plot function, we would need to pass the dates as the first argument and the response vector as the second argument. Check ou the examples below to understand how it works.
 4 7 4 4 6 4 3 4 9 5
 "2020-11-25" "2020-11-26" "2020-11-27" "2020-11-28" "2020-11-29"  "2020-11-30" "2020-12-01" "2020-12-02" "2020-12-03" "2020-12-04"
y<-sample(0:9,10,replace=TRUE) dates<-seq(as.Date("01/01/2020",format="%d/%m/%Y"),by="days",length=length(x)) plot(dates,y)
- How to create a plot with tick marks between X-axis labels in base R?
- How to create a plot with reversed Y-axis labels in base R?
- How to display X-axis labels with dash in base R plot?
- How to display raise to the power on X-axis in base R plot?
- How to create bar plot in base R with different limits for Y-axis?
- How to display X-axis labels inside the plot in base R?
- How to display superscript for X-axis title in base R plot?
- How to change the position of X-axis in base R plot?
- How to plot values with log scales on x and y axis or on a single axis in R?
- How to plot data against specific dates on the X-axis using Matplotlib?
- How to create a bar plot using ggplot2 with percentage on Y-axis in R?
- How to create a plot of quadratic regression with fitted values against X in base R?
- How to create a plot with dashed regression line in base R?
- How to change the axis color in base R plot?
- How to use mtext function to create the X-axis labels in base R?