lines()
or points()
will add to the existing graph, but will not create a new window. So you’d need to do
plot(x,y1,type="l",col="red")
lines(x,y2,col="green")
More Related Contents:
- How to save a plot as image on the disk?
- Plot two graphs in same plot in R
- How to plot a function curve in R
- ggplot with 2 y axes on each side and different scales
- Order discrete x scale by frequency/value
- How to use a variable to specify column name in ggplot
- How to set limits for axes in ggplot2 R plots?
- ggplot2 line chart gives “geom_path: Each group consist of only one observation. Do you need to adjust the group aesthetic?”
- Force the origin to start at 0
- Plot multiple columns on the same graph in R [duplicate]
- Generate multiple graphics from within an R function
- Remove space between plotted data and the axes
- Wrap long axis labels via labeller=label_wrap in ggplot2
- What do hjust and vjust do when making a plot using ggplot?
- How to set multiple legends / scales for the same aesthetic in ggplot2?
- Reduce PDF file size of plots by filtering hidden objects
- Difference between passing options in aes() and outside of it in ggplot2
- Filling area under curve based on value
- Pretty ticks for log normal scale using ggplot2 (dynamic not manual)
- ggplot2: How to specify multiple fill colors for points that are connected by lines of different colors
- Expand spacing between tick marks on x axis
- ggplot2 – adding secondary y-axis on top of a plot
- plots generated by ‘plot’ and ‘ggplot’ side-by-side
- Maps, ggplot2, fill by state is missing certain areas on the map
- What type of graph is this? And can it be created using ggplot2?
- Add raster to ggmap base map: set alpha (transparency) and fill color to inset_raster() in ggplot2
- Creating a vertical color gradient for a geom_bar plot
- How to define more line types for graphs in R (custom linetype)?
- heatmap-like plot, but for categorical variables
- In ggplot2, coord_flip and free scales don’t work together