I tried my best to get the reproducible examples.
library(ggplot2)
library(readxl)
D1 <- read_excel("E:/Gokul/R 1.xlsx",
sheet = "30-4-19")
D2 <- read_excel("E:/Gokul/R 1.xlsx",
sheet = "1-5-19")
D3 <- read_excel("E:/Gokul/R 1.xlsx",
sheet = "2-5-19")
# data for D1
structure(list(Time = c(3.891667, 3.9, 3.908333, 3.916667, 3.925,
3.933333, 3.941667, 3.95, 3.958333, 3.966667), PRN = c(1, 1,
1, 1, 1, 1, 1, 1, 1, 1), Lat = c(-10.728, -10.649, -10.571, -10.494,
-10.417, -10.341, -10.266, -10.192, -10.119, -10.046), Lon = c(141.988,
142.036, 142.084, 142.131, 142.177, 142.223, 142.268, 142.313,
142.357, 142.4), Stec = c(33.99, 34.41, 34.58, 35.01, 35.18,
35.44, 35.52, 35.58, 35.41, 35.54)), row.names = c(NA, -10L), class = c("tbl_df",
"tbl", "data.frame"))
#Data for D2
structure(list(Time = c(3.783333, 3.791667, 3.8, 3.808333, 3.816667,
3.825, 3.858333, 3.866667, 3.875, 3.883333), PRN = c(1, 1, 1,
1, 1, 1, 1, 1, 1, 1), Lat = c(-11.116, -11.033, -10.951, -10.87,
-10.789, -10.71, -10.399, -10.324, -10.249, -10.175), Lon = c(141.746,
141.798, 141.849, 141.899, 141.949, 141.998, 142.187, 142.233,
142.278, 142.322), Stec = c(19.93, 20.03, 20.3, 20.32, 20.2,
20.59, 20.59, 20.74, 20.8, 20.72)), row.names = c(NA, -10L), class = c("tbl_df",
"tbl", "data.frame"))
#Data for D3
structure(list(Time = c(3.716667, 3.725, 3.733333, 3.741667,
3.75, 3.758333, 3.766667, 3.775, 3.783333, 3.791667), PRN = c(1,
1, 1, 1, 1, 1, 1, 1, 1, 1), Lat = c(-11.098, -11.015, -10.933,
-10.852, -10.772, -10.692, -10.614, -10.536, -10.459, -10.383
), Lon = c(141.758, 141.81, 141.861, 141.911, 141.961, 142.009,
142.058, 142.105, 142.152, 142.198), Stec = c(33.48, 33.43, 33.38,
33.41, 33.24, 33.05, 33.08, 32.91, 32.71, 32.53)), row.names = c(NA,
-10L), class = c("tbl_df", "tbl", "data.frame"))
ggplot(D1,aes(x=Time,y=Stec))+
geom_line(aes(color="30-4-19"))+
geom_line(data=D2,aes(color="1-5-19"))+
geom_line(data=D3,aes(color="2-5-19"))+
labs(color="Legend text")
I hope it works.