How to scatter plot the following:
var1 var2
1 10 2
2 20 4
3 30 8
4 40 16
5 80 32
I need to color var1 and var2 with difft colors. x-axis should range from 1 to 5. How can I add a line showing trend of the data?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Your question is not very clear, but assuming your data is in df, it sounds like you want something like this to get started:
As for the trend of the data, what do you mean? A trend for each line? Or do you actually want to plot var1 against var2 (I have assumed you don’t want that otherwise there would be no point having two colours).