How to plot multiple lines on the same graph using R

preview_player
Показать описание
In this tutorial, you will find step-by-step instructions to create line graphs, especially multiple line graphs, and to place legends right on top of the lines. We will use R and ggplot2 to create these plots.

Here are the files used in this tutorial:

A couple of books mentioned in the tutorial:

Also, read more about the banking function in R here:

Рекомендации по теме
Комментарии
Автор

3 days of suffering trying to figure this out, you helped me do it in 5 minutes. thank you so much

olivernicholls
Автор

I am searching for this from the time I learnt about R studio. One very important point is we Excel users are used to plot data based on column name but here we need to stack the data in one single column. It took me many days to figure out. 😁

KartheeKSoNTI
Автор

You just saved me from headache...THANKS!!!

chidiebereogbuchi
Автор

So nicely explained concepts of GG Plot. Keep it up.

TheMunishk
Автор

Pls make video on two dot plot in same graph with the help of ggplot 2

ROHITSingh-pdco
Автор

How would you make multiple lines for different variables? I.e ones that are not grouped. For example, I have a data frame with the Egg mass of a quail egg, and I want to compare the shell mass with each of the egg components (Shell mass, yolk mass and albumen mass). Each of those components are under a new column in my data frame: How would I plot them all on the same graph against the egg mass?

CCoreOW
Автор

Thank you very much, it is a nice tutorial

justinatuulikefonangolo
Автор

Thank you very much! your graph is really nice.
I have a question:
How can I create a double axis graph?

alejandrosantos
Автор

It is possible to plot two density histograms from two different data frames in a single graph?

TOPAZBLUEFOX
Автор

can I extend this to more than 3 sets of stock data?

harrisonbooth
Автор

nice tutorial! how to export graphs in png /jpg?

zasaconsulting
Автор

Sir, I made a ggplot using the geom_line() function two times to show the two different lines on the same plot. My data is bivariate data. I am unable to put the legends for both two line. Kindly help me to resolve it. If you share your email id, I can share with you my codes. Sir, I am at the very initial stage of programming. Plz help if possible

babikhandelwal
Автор

Do you know how to plot multiple lines in the same graph, and start from the same value, for example $100?
Then like you can compare Netflix, Amazon, Apple from 2009 to 2019?

Mads_Vel
Автор

which software you have used for creating this graph?

ManhwasForLife
Автор

Thanks for this video!!
Is there a possibility to add multuple lines but from another Dataframe?
I have one large dataframe but made subsets. I want to plot the lines of the subsets which is based on a condition of a variable.
Or is there a possibility to load one big dataframe and to make different lines based on a condition?

sarabdn
Автор

You saved me Boss - Times when I realize that Python is a shit-tool for basic visualization

arunjohn
Автор

Really good video. But you rushed the part on creating multiple lines.

tommy.h.descartes