-1

I have two density distribution data A and B, I want to plot the two density curves into one plot. I used the following codes:

plot(user.dens.tas, col="red", xlim=c(0,0.003))
plot(item.dens.tas, col="blue", xlim=c(0,0.003))

How can I plot the two curves into one plot (combine them)?

enter image description here

2
  • On second line use lines() instead of plot(). Commented Aug 18, 2014 at 8:17
  • how to do this in python? Commented Jun 22, 2021 at 20:29

1 Answer 1

0
plot(user.dens.tas, col="red", xlim=c(0,0.003))
lines(item.dens.tas, col="blue", xlim=c(0,0.003))

Puts one line in read, the other in blue on the same plot. You might also consider adding a title and other presentation niceties.

Sign up to request clarification or add additional context in comments.

1 Comment

do you know how to do this in python?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.