Reputation: 161
I have a dataframe which looks like this:
Monday Tuesday Wednesday Thursday Friday Saturday Sunday Monday.1 Tuesday.1
5.3 2.2 1 7 8.3 5 6.4 7 2
And I want the desired plot like shown in the Image:
Any help would be grateful
Dput:
structure(list(Wednesday = 7.4375, Thursday = 7.94791666666667,
Friday = 7.14583333333333, Saturday = 4.325, Sunday = 4.41304347826087,
Monday = 7.95125, Tuesday = 8.09375, Wednesday.1 = 7.85416666666667,
Thursday.1 = 8.58333333333333, Friday.1 = 6.02173913043478,
Saturday.1 = 2.80952380952381, Sunday.1 = 2.66666666666667), row.names = c(NA,
-1L), class = c("data.table", "data.frame"), .internal.selfref = <pointer: (nil)>)
Upvotes: 0
Views: 33
Reputation: 32548
plot(1:NCOL(df1), df1[1,], type = "h", lwd = 4, lend = "butt", xaxt = "n")
lines(spline(1:NCOL(df1), df1[1,]))
axis(1, at = 1:NCOL(df1), labels = names(df1), las = 2)
Upvotes: 1