how to make this plot attractive ?

I want to make this plot attractive. Please suggest.
please share the package name and sample codes.
Thanks in advance.

Hi zeeshan0112,

it is very unlikely that you will get valuable feedback based on your very general question, i.e. what does mean attractive to you, what is the purpose of the plot, what is the story you want to tell? But more importantly this is a coding community so if you seek to get some data visualization input I would ask somehwere else, e.g. DataVizSociety.

The R Graph Gallery provides various examples and code snippets for all types of charts, most of them looking "attractive". This might be of help.

3 Likes

Wow! That graph gallery looks great. Surprised I hadn't stumbled upon that before.

I would also suggest you have a look at:

http://r-statistics.co/Top50-Ggplot2-Visualizations-MasterList-R-Code.html

1 Like

pretty is relative, it strongly depends on the person. Also code is difficult as you don't share your input.
You may have a look at this: http://r-statistics.co/Top50-Ggplot2-Visualizations-MasterList-R-Code.html#Time%20Series%20Plot%20From%20Long%20Data%20Format
In general ggplot offers a high level of adaptability, you can adjust everything.

Technically there is a big flaw: You don't have a legend and tell what the colours indicate.
You can make the labels bigger, also there is enough space on the x-axis to show all the other years, and maybe add some tick marks for half years. You can make the title more explanatory, e.g. "The LIBOR rate (2010-2020) for different lengths"(?).
You could make the lines thicker, so they lose some of their noisyness.
I personally don't like the boarder around the plotting area but this is my preference.

1 Like
data
date libor_1m libor_3m libor_6m
04-01-2010 0.23344 0.25438 0.43438
05-01-2010 0.23344 0.2525 0.4275
06-01-2010 0.23219 0.25 0.42563
07-01-2010 0.23125 0.24938 0.4175
08-01-2010 0.23313 0.25125 0.42
11-01-2010 0.23313 0.25125 0.40375
12-01-2010 0.23313 0.25125 0.4
13-01-2010 0.23313 0.25125 0.4
14-01-2010 0.23313 0.25125 0.39875
15-01-2010 0.23313 0.25125 0.3925
18-01-2010 0.23063 0.24875 0.39
19-01-2010 0.23063 0.249 0.39063
20-01-2010 0.23063 0.24888 0.39
21-01-2010 0.23063 0.24888 0.39031
22-01-2010 0.23063 0.24906 0.38469
25-01-2010 0.23063 0.24875 0.38563
26-01-2010 0.23063 0.24875 0.3825
27-01-2010 0.23063 0.24875 0.38344
28-01-2010 0.22875 0.24875 0.38563
29-01-2010 0.22906 0.24906 0.38438
01-02-2010 0.22906 0.24906 0.38375
02-02-2010 0.23094 0.25031 0.38375
03-02-2010 0.22906 0.24906 0.38375
04-02-2010 0.22844 0.24875 0.385
05-02-2010 0.22844 0.24969 0.385
08-02-2010 0.22844 0.25 0.38625
09-02-2010 0.22844 0.25 0.38875
10-02-2010 0.22844 0.25 0.38875
11-02-2010 0.23063 0.25 0.39
12-02-2010 0.23188 0.25 0.38813
15-02-2010 0.22875 0.25 0.38813
16-02-2010 0.22875 0.25 0.38813
17-02-2010 0.22875 0.25063 0.385
18-02-2010 0.22875 0.25125 0.38438
19-02-2010 0.22875 0.25194 0.39531
22-02-2010 0.22875 0.25219 0.39313
23-02-2010 0.22875 0.25194 0.39375
24-02-2010 0.22875 0.25194 0.39125
25-02-2010 0.22875 0.25194 0.38688
26-02-2010 0.22875 0.25169 0.38688
01-03-2010 0.22813 0.25169 0.38375
02-03-2010 0.22813 0.25194 0.38319
03-03-2010 0.22813 0.25194 0.38319
04-03-2010 0.22813 0.25219 0.38319
05-03-2010 0.22906 0.25363 0.39
08-03-2010 0.23 0.25425 0.39531
09-03-2010 0.23 0.2555 0.39438
10-03-2010 0.23 0.25563 0.39438
11-03-2010 0.23 0.25703 0.39344
12-03-2010 0.23 0.25719 0.39781
15-03-2010 0.23031 0.25763 0.40063
16-03-2010 0.23563 0.26088 0.40125
17-03-2010 0.23744 0.26638 0.40188
18-03-2010 0.23975 0.271 0.40766
19-03-2010 0.24506 0.2775 0.42325
22-03-2010 0.24719 0.28188 0.43656
23-03-2010 0.24606 0.28353 0.43375
24-03-2010 0.24619 0.28491 0.43531
25-03-2010 0.24694 0.28781 0.43688
26-03-2010 0.24688 0.28875 0.43938
29-03-2010 0.24788 0.29013 0.4425
30-03-2010 0.24863 0.29088 0.44188
31-03-2010 0.24863 0.2915 0.44438
01-04-2010 0.24863 0.2915 0.44156
06-04-2010 0.25075 0.29488 0.45438
07-04-2010 0.25138 0.29525 0.4525
08-04-2010 0.25013 0.294 0.4525
09-04-2010 0.25288 0.29781 0.45375
12-04-2010 0.25298 0.30041 0.45563
13-04-2010 0.25438 0.30281 0.45563
14-04-2010 0.25594 0.30375 0.4625
15-04-2010 0.25625 0.30438 0.465
16-04-2010 0.25563 0.30531 0.46438
19-04-2010 0.2575 0.30531 0.46063
20-04-2010 0.25875 0.30719 0.465
21-04-2010 0.26063 0.31281 0.4725
22-04-2010 0.2625 0.31578 0.48219
23-04-2010 0.26438 0.32063 0.49281
26-04-2010 0.26469 0.32375 0.50031
27-04-2010 0.26672 0.32781 0.50563
28-04-2010 0.27313 0.33781 0.5225
29-04-2010 0.27766 0.34438 0.52719
30-04-2010 0.28 0.34656 0.53063
04-05-2010 0.28469 0.35313 0.54578
05-05-2010 0.29094 0.36016 0.55531
06-05-2010 0.29706 0.37359 0.56563
07-05-2010 0.34875 0.42813 0.63688
10-05-2010 0.34 0.42125 0.6225
11-05-2010 0.3375 0.42281 0.6185
12-05-2010 0.33813 0.43019 0.62231
13-05-2010 0.33688 0.43588 0.62263
14-05-2010 0.33775 0.44506 0.635
17-05-2010 0.33894 0.46 0.65475
18-05-2010 0.33969 0.46469 0.655
19-05-2010 0.34106 0.4775 0.67338
20-05-2010 0.34131 0.48406 0.67875
21-05-2010 0.34281 0.49688 0.69563
24-05-2010 0.34525 0.50969 0.71625
25-05-2010 0.354 0.53625 0.75913
26-05-2010 0.35406 0.53781 0.75788
27-05-2010 0.35375 0.53844 0.7585
28-05-2010 0.35125 0.53625 0.75188
01-06-2010 0.35088 0.53625 0.76113
02-06-2010 0.35088 0.5375 0.75363
03-06-2010 0.35088 0.53781 0.753
04-06-2010 0.35 0.53656 0.74919
07-06-2010 0.35 0.53719 0.75731
08-06-2010 0.35 0.53688 0.75363
09-06-2010 0.35031 0.53656 0.75081
10-06-2010 0.34969 0.53644 0.74938
11-06-2010 0.34969 0.53706 0.74613
14-06-2010 0.34969 0.53706 0.75031
15-06-2010 0.34969 0.53894 0.75481
16-06-2010 0.34844 0.53894 0.75456
17-06-2010 0.3475 0.53925 0.75475
18-06-2010 0.34734 0.53819 0.75063
21-06-2010 0.34719 0.53838 0.74956
22-06-2010 0.34719 0.53825 0.747
23-06-2010 0.34719 0.53825 0.74869
24-06-2010 0.34719 0.53719 0.75194
25-06-2010 0.34719 0.53469 0.75319
28-06-2010 0.34719 0.53344 0.74719
29-06-2010 0.34563 0.533 0.75069
30-06-2010 0.34844 0.53394 0.7525
01-07-2010 0.34719 0.53331 0.751
02-07-2010 0.3475 0.53363 0.75006
05-07-2010 0.34625 0.53125 0.74344
06-07-2010 0.34625 0.53113 0.74244
07-07-2010 0.345 0.52988 0.74244
08-07-2010 0.3425 0.5275 0.73719
09-07-2010 0.34094 0.52681 0.73319
12-07-2010 0.34094 0.52556 0.73163
13-07-2010 0.34094 0.52594 0.73313
14-07-2010 0.34094 0.52563 0.73131
15-07-2010 0.34063 0.52469 0.72988
16-07-2010 0.33813 0.52125 0.72656
19-07-2010 0.33688 0.51781 0.71813
20-07-2010 0.3325 0.5125 0.71088
21-07-2010 0.33063 0.50625 0.70263
22-07-2010 0.32875 0.49781 0.70075
23-07-2010 0.32688 0.49313 0.697
26-07-2010 0.325 0.4875 0.69769
27-07-2010 0.32063 0.48125 0.69431
28-07-2010 0.31563 0.475 0.68794
29-07-2010 0.31156 0.46563 0.67769
30-07-2010 0.305 0.45375 0.66781
02-08-2010 0.30281 0.44469 0.65994
03-08-2010 0.3 0.43469 0.64956
04-08-2010 0.29531 0.42406 0.63831
05-08-2010 0.29469 0.41813 0.63894
06-08-2010 0.29344 0.41125 0.63375
09-08-2010 0.29 0.40438 0.6275
10-08-2010 0.28563 0.39781 0.62031
11-08-2010 0.27938 0.38438 0.6025
12-08-2010 0.27594 0.37625 0.59406
13-08-2010 0.27188 0.36938 0.59188
16-08-2010 0.26938 0.36188 0.58731
17-08-2010 0.26656 0.35219 0.5765
18-08-2010 0.26625 0.34547 0.56844
19-08-2010 0.26469 0.33906 0.55594
20-08-2010 0.26438 0.32922 0.54563
23-08-2010 0.26375 0.3175 0.53375
24-08-2010 0.26156 0.3075 0.51831
25-08-2010 0.26156 0.30375 0.51125
26-08-2010 0.26031 0.29938 0.50725
27-08-2010 0.25938 0.29688 0.50319
31-08-2010 0.25781 0.29563 0.49669
01-09-2010 0.25781 0.29563 0.49625
02-09-2010 0.25781 0.29438 0.49563
03-09-2010 0.25781 0.29281 0.49363
06-09-2010 0.25766 0.29219 0.48922
07-09-2010 0.25766 0.29188 0.48875
08-09-2010 0.25734 0.2925 0.48953
09-09-2010 0.25734 0.2925 0.49
10-09-2010 0.25734 0.29219 0.48969
13-09-2010 0.25734 0.29219 0.48719
14-09-2010 0.25734 0.29188 0.48188
15-09-2010 0.25734 0.29203 0.47453
16-09-2010 0.25734 0.29141 0.47438
17-09-2010 0.2575 0.29156 0.47313
20-09-2010 0.25625 0.29031 0.47313
21-09-2010 0.25625 0.28969 0.47313
22-09-2010 0.25625 0.28938 0.46406
23-09-2010 0.25625 0.28938 0.46281
24-09-2010 0.25625 0.28938 0.46406
27-09-2010 0.25625 0.28938 0.4625
28-09-2010 0.25625 0.28938 0.4625
29-09-2010 0.25625 0.29 0.4625
30-09-2010 0.25625 0.29 0.4625
01-10-2010 0.25688 0.29063 0.46313
04-10-2010 0.25688 0.29063 0.46313
05-10-2010 0.25688 0.29 0.46188
06-10-2010 0.25688 0.28969 0.46156
07-10-2010 0.25625 0.28906 0.45875
08-10-2010 0.25625 0.28906 0.4575
11-10-2010 0.25625 0.28906 0.45656
12-10-2010 0.25625 0.28906 0.455
13-10-2010 0.25625 0.28906 0.455
14-10-2010 0.25625 0.28906 0.45375
15-10-2010 0.25625 0.28906 0.4525
18-10-2010 0.25625 0.28906 0.4525
19-10-2010 0.25625 0.28906 0.4525
20-10-2010 0.25625 0.28844 0.45375
21-10-2010 0.25625 0.28844 0.4525
22-10-2010 0.25625 0.28844 0.4525
25-10-2010 0.25625 0.28844 0.4525
26-10-2010 0.25531 0.28844 0.45125
27-10-2010 0.25531 0.28813 0.45031
28-10-2010 0.25406 0.28688 0.44981
29-10-2010 0.25375 0.28594 0.44844
01-11-2010 0.25375 0.28594 0.44563
02-11-2010 0.25375 0.28594 0.44563
03-11-2010 0.25375 0.28594 0.44438
04-11-2010 0.25344 0.28563 0.4425
05-11-2010 0.25344 0.28563 0.44188
08-11-2010 0.25344 0.28563 0.4425
09-11-2010 0.25344 0.28563 0.44281
10-11-2010 0.25344 0.28563 0.44281
11-11-2010 0.25344 0.28563 0.44281
12-11-2010 0.25344 0.28438 0.44281
15-11-2010 0.25344 0.28438 0.4425
16-11-2010 0.25344 0.28438 0.44219
17-11-2010 0.25344 0.28438 0.44219
18-11-2010 0.25344 0.28438 0.44219
19-11-2010 0.25344 0.28438 0.44219
22-11-2010 0.25344 0.28438 0.44219
23-11-2010 0.25344 0.28438 0.44219
24-11-2010 0.25344 0.2875 0.44688
25-11-2010 0.255 0.29188 0.45625
26-11-2010 0.25625 0.29438 0.45875
29-11-2010 0.2575 0.29594 0.45906
30-11-2010 0.26063 0.30031 0.461
01-12-2010 0.26531 0.30344 0.46656
02-12-2010 0.26563 0.30344 0.46531
03-12-2010 0.265 0.30344 0.46219
06-12-2010 0.265 0.30344 0.45969
07-12-2010 0.26375 0.30219 0.45719
08-12-2010 0.2625 0.30219 0.45844
09-12-2010 0.26219 0.30219 0.45719
10-12-2010 0.26031 0.30156 0.45719
13-12-2010 0.26031 0.30156 0.45631
14-12-2010 0.26063 0.30188 0.45619
15-12-2010 0.26063 0.30188 0.45781
16-12-2010 0.26063 0.30375 0.45969
17-12-2010 0.26063 0.30375 0.45719
20-12-2010 0.26063 0.30281 0.45719
21-12-2010 0.26063 0.30281 0.45719
22-12-2010 0.26063 0.30281 0.45719
23-12-2010 0.26063 0.30281 0.45719
24-12-2010 0.26063 0.30281 0.45719
29-12-2010 0.26063 0.30281 0.45688
30-12-2010 0.26063 0.30281 0.45656
31-12-2010 0.26063 0.30281 0.45594
04-01-2011 0.26063 0.30281 0.45581
05-01-2011 0.26125 0.30281 0.45456
06-01-2011 0.26125 0.30313 0.45719
07-01-2011 0.26125 0.30313 0.45731
10-01-2011 0.26125 0.30313 0.45706
11-01-2011 0.26125 0.30313 0.45694
12-01-2011 0.26125 0.30313 0.45681
13-01-2011 0.26125 0.30313 0.45656
14-01-2011 0.26125 0.30313 0.45594
17-01-2011 0.26125 0.30313 0.45469
18-01-2011 0.26063 0.30313 0.45469
19-01-2011 0.26 0.30313 0.45469
20-01-2011 0.26 0.30313 0.45469
21-01-2011 0.26 0.30313 0.45469
24-01-2011 0.26 0.30313 0.45469
25-01-2011 0.26 0.30438 0.45469
26-01-2011 0.26 0.30438 0.45469
27-01-2011 0.26 0.30438 0.45469
28-01-2011 0.26 0.30438 0.45381
31-01-2011 0.26 0.30438 0.45381
01-02-2011 0.263 0.3105 0.46075
02-02-2011 0.263 0.3105 0.46075
03-02-2011 0.263 0.3105 0.46125
04-02-2011 0.26275 0.3115 0.46125
07-02-2011 0.26375 0.312 0.46285
08-02-2011 0.264 0.312 0.46435
09-02-2011 0.264 0.312 0.4652
10-02-2011 0.264 0.312 0.4647
11-02-2011 0.26575 0.313 0.4652
14-02-2011 0.26475 0.314 0.4657
15-02-2011 0.264 0.3135 0.4657
16-02-2011 0.263 0.3135 0.4652
17-02-2011 0.263 0.3135 0.4655
18-02-2011 0.262 0.3125 0.4655
21-02-2011 0.262 0.3125 0.465
22-02-2011 0.2615 0.3125 0.465
23-02-2011 0.2615 0.3115 0.465
24-02-2011 0.2615 0.3105 0.464
25-02-2011 0.261 0.3105 0.464
28-02-2011 0.261 0.3095 0.464
01-03-2011 0.261 0.3095 0.4625
02-03-2011 0.26 0.3095 0.4615
03-03-2011 0.26 0.3095 0.4615
04-03-2011 0.26 0.3095 0.4625
07-03-2011 0.259 0.3095 0.4625
08-03-2011 0.258 0.3095 0.4615
09-03-2011 0.258 0.3095 0.4615
10-03-2011 0.2555 0.3095 0.4615
11-03-2011 0.255 0.3095 0.461
14-03-2011 0.2535 0.309 0.461
15-03-2011 0.2535 0.309 0.46
16-03-2011 0.2535 0.309 0.46
17-03-2011 0.2535 0.309 0.46
18-03-2011 0.2535 0.309 0.46
21-03-2011 0.2525 0.309 0.46
22-03-2011 0.252 0.309 0.46
23-03-2011 0.2495 0.308 0.46
24-03-2011 0.24825 0.3085 0.46
25-03-2011 0.24825 0.3075 0.46
28-03-2011 0.24765 0.307 0.4605
29-03-2011 0.24615 0.307 0.4605
30-03-2011 0.2438 0.3045 0.4605
31-03-2011 0.24345 0.303 0.4595
01-04-2011 0.24295 0.301 0.4595
04-04-2011 0.2399 0.29675 0.45875
05-04-2011 0.2355 0.29375 0.4565
06-04-2011 0.2335 0.29263 0.4545
07-04-2011 0.23138 0.2895 0.45088
08-04-2011 0.2265 0.28525 0.4475
11-04-2011 0.2238 0.28275 0.4445
12-04-2011 0.2211 0.28075 0.4425
13-04-2011 0.21875 0.278 0.4415
14-04-2011 0.21585 0.2755 0.4385
15-04-2011 0.21375 0.27475 0.437
18-04-2011 0.21295 0.274 0.435
19-04-2011 0.2126 0.27375 0.43375
20-04-2011 0.2126 0.27375 0.43325
21-04-2011 0.2126 0.27375 0.43325
26-04-2011 0.21135 0.27275 0.43225
27-04-2011 0.2105 0.27325 0.43175
28-04-2011 0.21025 0.273 0.4305
03-05-2011 0.2095 0.27225 0.43025
04-05-2011 0.209 0.27025 0.4285
05-05-2011 0.2062 0.26825 0.427
06-05-2011 0.20385 0.267 0.425
09-05-2011 0.20185 0.26575 0.42325
10-05-2011 0.20025 0.264 0.42125
11-05-2011 0.19875 0.26225 0.4205
12-05-2011 0.198 0.26075 0.417
13-05-2011 0.1971 0.2605 0.415
16-05-2011 0.197 0.2605 0.4125
17-05-2011 0.197 0.25975 0.412
18-05-2011 0.19575 0.26 0.41
19-05-2011 0.19525 0.2585 0.40875
20-05-2011 0.19475 0.2575 0.40725
23-05-2011 0.194 0.25675 0.4055
24-05-2011 0.1927 0.255 0.4045
25-05-2011 0.19235 0.2545 0.40375
26-05-2011 0.19125 0.254 0.40375
27-05-2011 0.19103 0.25388 0.40263
31-05-2011 0.19043 0.25288 0.40313
01-06-2011 0.19043 0.25288 0.40263
02-06-2011 0.19018 0.252 0.40138
03-06-2011 0.1898 0.252 0.401
06-06-2011 0.18955 0.25175 0.401
07-06-2011 0.18955 0.25175 0.4
08-06-2011 0.18955 0.25025 0.39775
09-06-2011 0.18955 0.2495 0.39675
10-06-2011 0.18855 0.2485 0.39675
13-06-2011 0.18705 0.247 0.3945
14-06-2011 0.18555 0.24525 0.3935
15-06-2011 0.1853 0.245 0.39325
16-06-2011 0.1858 0.2465 0.395
17-06-2011 0.1858 0.2465 0.395
20-06-2011 0.1858 0.2465 0.39475
21-06-2011 0.1858 0.2455 0.39475
22-06-2011 0.1858 0.2455 0.39475
23-06-2011 0.1858 0.2465 0.39575
24-06-2011 0.18555 0.24625 0.39675
27-06-2011 0.18555 0.24575 0.40275
28-06-2011 0.18555 0.24575 0.40075
29-06-2011 0.18555 0.24575 0.40025
30-06-2011 0.18555 0.24575 0.39775
01-07-2011 0.18505 0.24575 0.39725
04-07-2011 0.18505 0.24575 0.39725
05-07-2011 0.18505 0.24575 0.39725
06-07-2011 0.18525 0.24575 0.39875
07-07-2011 0.18575 0.24605 0.39875
08-07-2011 0.18575 0.24605 0.39875
11-07-2011 0.18575 0.24605 0.40275
12-07-2011 0.1865 0.249 0.40975
13-07-2011 0.1865 0.24925 0.41325
14-07-2011 0.1865 0.24975 0.41575
15-07-2011 0.1865 0.24975 0.4165
18-07-2011 0.18625 0.25125 0.42
19-07-2011 0.18625 0.252 0.423
20-07-2011 0.18725 0.253 0.423
21-07-2011 0.18725 0.253 0.4235
22-07-2011 0.18725 0.253 0.4225
25-07-2011 0.18725 0.2521 0.4245
26-07-2011 0.18725 0.2526 0.425
27-07-2011 0.18725 0.25285 0.42625
28-07-2011 0.18825 0.25395 0.4285
29-07-2011 0.1911 0.2555 0.43025
01-08-2011 0.19206 0.25722 0.43167
02-08-2011 0.20083 0.26444 0.4375
03-08-2011 0.20556 0.26828 0.44028
04-08-2011 0.20506 0.26939 0.44056
05-08-2011 0.2055 0.27161 0.44278
08-08-2011 0.20578 0.27478 0.44333
09-08-2011 0.208 0.27839 0.44828
10-08-2011 0.20711 0.28061 0.44828
11-08-2011 0.20722 0.28617 0.45183
12-08-2011 0.20833 0.29006 0.45672
15-08-2011 0.21022 0.29172 0.45928
16-08-2011 0.21022 0.29283 0.45983
17-08-2011 0.21244 0.29589 0.45983
18-08-2011 0.213 0.29778 0.46294
19-08-2011 0.21544 0.303 0.46706
22-08-2011 0.21678 0.30844 0.47111
23-08-2011 0.21839 0.31178 0.47528
24-08-2011 0.21894 0.31428 0.47639
25-08-2011 0.22083 0.319 0.48028
26-08-2011 0.22094 0.32278 0.47994
30-08-2011 0.2215 0.32556 0.48333
31-08-2011 0.2215 0.32722 0.48578
01-09-2011 0.2215 0.32944 0.48878
02-09-2011 0.22178 0.33056 0.49039
05-09-2011 0.22439 0.33278 0.49606
06-09-2011 0.226 0.33561 0.50161
07-09-2011 0.22611 0.33683 0.50294
08-09-2011 0.225 0.33683 0.50411
09-09-2011 0.22611 0.33794 0.50439
12-09-2011 0.22861 0.34289 0.51328
13-09-2011 0.229 0.34711 0.51694
14-09-2011 0.22939 0.34911 0.52089
15-09-2011 0.22994 0.35022 0.52228
16-09-2011 0.2305 0.35133 0.52283
19-09-2011 0.23072 0.3525 0.52478
20-09-2011 0.23183 0.355 0.527
21-09-2011 0.2335 0.35556 0.52922
22-09-2011 0.23456 0.35806 0.537
23-09-2011 0.23578 0.36022 0.53956
26-09-2011 0.23744 0.36278 0.54172
27-09-2011 0.23878 0.36522 0.5445
28-09-2011 0.23889 0.36856 0.54839
29-09-2011 0.23944 0.37211 0.55394
30-09-2011 0.23944 0.37433 0.55783
03-10-2011 0.24 0.37761 0.56139
04-10-2011 0.24111 0.38094 0.567
05-10-2011 0.24067 0.38361 0.57161
06-10-2011 0.24233 0.38778 0.578
07-10-2011 0.24289 0.39111 0.58056
10-10-2011 0.243 0.39417 0.5825
11-10-2011 0.24311 0.3975 0.58694
12-10-2011 0.24322 0.40083 0.58806
13-10-2011 0.24333 0.40306 0.59167
14-10-2011 0.24333 0.40472 0.59306
17-10-2011 0.24444 0.40583 0.59556
18-10-2011 0.24472 0.40917 0.59778
19-10-2011 0.24472 0.41167 0.60028
20-10-2011 0.24472 0.41556 0.6025
21-10-2011 0.24472 0.41833 0.60667
24-10-2011 0.24472 0.42028 0.61
25-10-2011 0.24472 0.42222 0.61222
26-10-2011 0.24583 0.42472 0.61556
27-10-2011 0.24583 0.42806 0.61889
28-10-2011 0.24583 0.42944 0.61972
31-10-2011 0.24528 0.42944 0.61944
01-11-2011 0.24528 0.43167 0.6225
02-11-2011 0.24528 0.43306 0.62389
03-11-2011 0.2475 0.435 0.62694
04-11-2011 0.2475 0.4375 0.63111
07-11-2011 0.24778 0.44139 0.63667
08-11-2011 0.24778 0.44417 0.64167
09-11-2011 0.24778 0.44917 0.64833
10-11-2011 0.24789 0.45278 0.65417
11-11-2011 0.249 0.45722 0.65861
14-11-2011 0.25022 0.46056 0.66222
15-11-2011 0.25172 0.46556 0.66972
16-11-2011 0.25172 0.47111 0.67694
17-11-2011 0.25478 0.47944 0.68917
18-11-2011 0.25656 0.48778 0.69861
21-11-2011 0.25667 0.495 0.70611
22-11-2011 0.25722 0.50028 0.71222
23-11-2011 0.25722 0.50611 0.71889
24-11-2011 0.25722 0.51167 0.72611
25-11-2011 0.25944 0.51806 0.73417
28-11-2011 0.26 0.52306 0.73972
29-11-2011 0.27022 0.52694 0.74583
30-11-2011 0.27144 0.52889 0.74833
01-12-2011 0.27144 0.52722 0.74722
02-12-2011 0.27033 0.52833 0.74833
05-12-2011 0.2741 0.5339 0.75425
06-12-2011 0.27505 0.53775 0.75825
07-12-2011 0.2763 0.54 0.76
08-12-2011 0.2763 0.54 0.7605
09-12-2011 0.27655 0.54175 0.762
12-12-2011 0.27755 0.5435 0.7645
13-12-2011 0.2783 0.54625 0.7705
14-12-2011 0.28255 0.55505 0.7785
15-12-2011 0.2846 0.55915 0.783
16-12-2011 0.28485 0.56315 0.788
19-12-2011 0.28735 0.56695 0.7945
20-12-2011 0.2906 0.56975 0.7985
21-12-2011 0.29185 0.57125 0.7995
22-12-2011 0.2936 0.57375 0.801
23-12-2011 0.29395 0.57575 0.804
28-12-2011 0.2963 0.57925 0.808
29-12-2011 0.2953 0.581 0.8085
30-12-2011 0.2953 0.581 0.8085
03-01-2012 0.2953 0.5825 0.811
04-01-2012 0.2953 0.5825 0.811
05-01-2012 0.2953 0.5825 0.812
06-01-2012 0.2963 0.5815 0.812
09-01-2012 0.2963 0.5805 0.81
10-01-2012 0.2958 0.5795 0.8085
11-01-2012 0.2947 0.5765 0.80675
12-01-2012 0.2896 0.5715 0.80225
13-01-2012 0.2851 0.567 0.79425
16-01-2012 0.2816 0.5649 0.79325
17-01-2012 0.281 0.5623 0.79275
18-01-2012 0.2809 0.5612 0.79175
19-01-2012 0.2789 0.5612 0.79175
20-01-2012 0.2773 0.5611 0.79175
23-01-2012 0.2763 0.5601 0.79275
24-01-2012 0.2753 0.5591 0.79125
25-01-2012 0.2728 0.5566 0.79175
26-01-2012 0.2705 0.5531 0.78675
27-01-2012 0.27 0.5511 0.78525
30-01-2012 0.26775 0.54685 0.7815
31-01-2012 0.26475 0.54235 0.77825
01-02-2012 0.264 0.5371 0.7725
02-02-2012 0.2625 0.5306 0.77
03-02-2012 0.2605 0.527 0.7685
06-02-2012 0.25975 0.52325 0.76875
07-02-2012 0.257 0.52 0.766
08-02-2012 0.25475 0.51325 0.76225
09-02-2012 0.2535 0.51 0.7586
10-02-2012 0.2505 0.506 0.7581
13-02-2012 0.2485 0.5026 0.7556
14-02-2012 0.2475 0.4976 0.7536
15-02-2012 0.246 0.4951 0.7521
16-02-2012 0.2455 0.4931 0.7521
17-02-2012 0.2455 0.4931 0.7511
20-02-2012 0.2455 0.4931 0.7511
21-02-2012 0.2455 0.4926 0.7521
22-02-2012 0.2445 0.4916 0.7531
23-02-2012 0.244 0.4906 0.7531
24-02-2012 0.244 0.4906 0.7531
27-02-2012 0.244 0.4891 0.7521
28-02-2012 0.244 0.4875 0.7505
29-02-2012 0.2435 0.48425 0.74875
01-03-2012 0.243 0.4797 0.7482
02-03-2012 0.24275 0.47575 0.74525
05-03-2012 0.24275 0.47455 0.7432

i want a graph like this

Thanks in advance

What have you tried so far? what is your specific problem?, we are more inclined towards helping you with specific coding problems rather than doing your work for you.

Could you please turn this into a self-contained REPRoducible EXample (reprex)? A reprex makes it much easier for others to understand your issue and figure out how to help.

If you've never heard of a reprex before, you might want to start by reading this FAQ:

1 Like

I have pointed you already at the R Graph Gallery which comes with the full code! And some others shared great resources as well. What else are you expecting us to do for you?

Here is the link to the exact graph you are looking for, including a modern design: https://www.r-graph-gallery.com/line-chart-several-groups-ggplot2.html

Good luck.

As Andres said, with a more detailed explanation of your problem (and what you did and achieved before) it's easier to find help.

If your data is in a dataframe as illustrated in your example you need to convert this first to a long format, then you can also replace the names to something nicer. Here I assume your data is in "input":

library(tidyverse)
df = input %>%
  pivot_longer(-date, names_to = "ID") %>% 
  mutate(ID = case_when(ID == "libor_1m" ~ "1 month",
                       ID == "libor_3m" ~ "3 months",
                       ID == "libor_6m" ~ "6 months")) %>% 
  mutate(value = as.numeric(value)) # this might not be needed for you

head(df)
# A tibble: 6 x 3
  date                ID       value
  <dttm>              <chr>    <dbl>
1 2010-01-04 00:00:00 1 month  0.233
2 2010-01-04 00:00:00 3 months 0.254
3 2010-01-04 00:00:00 6 months 0.434
4 2010-01-05 00:00:00 1 month  0.233
5 2010-01-05 00:00:00 3 months 0.252
6 2010-01-05 00:00:00 6 months 0.428

Then you can plot this, as said above ggplot offers high level of flexibility:

ggplot(df, aes(x=date, y = value, colour = ID)) +
  geom_line(size = 1.25) + 
  theme_minimal(base_size = 14) + # minimalistic theme with bigger font
  scale_x_datetime(date_labels = "%b\n%Y") + # desing of x axis 
  # define a harmonic colour range:
  scale_colour_viridis_d("", option = "inferno", begin = 0.25, end = 0.75) + 
  # adding better labels:
  labs(title = "LIBOR-rate (2010-2020) for different durations",
       subtitle = "for longer durations the rate is higher",
       x = "", # or "year" but it should be clear with the date given
       y = "Libor rate (in percent)",
       caption = "from: www.libor-rates.org") + 
  # center the title:
  theme(
    plot.title = element_text(hjust = 0.5),
    plot.subtitle = element_text(hjust = 0.5))

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.