Plot multiple Y variables in a scatter plot

时间:2016-04-25 08:57:42

标签: r plot ggplot2 scatter-plot

I tried the following code

plot(start, Pinkpop_df1[3:5,])

But I get an error;

Error in xy.coords(x, y, xlabel, ylabel, log) : 'x' and 'y' lengths differ

How can I plot multiple Y variables for each x variable? (start is the x variable for which I want to plot multiple y variables in the same scatterplot)

1 个答案:

答案 0 :(得分:0)

Try this:

plot(cbind(start,Pinkpop_df1[3:5,]))

There are several ways of calling plot and your tried a wrong mix of them.