Re: [R] Plotting Multiple lines on one plot

From: hadley wickham <h.wickham_at_gmail.com>
Date: Wed, 23 Jul 2008 09:09:49 -0500

The easiest way to do with this ggplot2 is to melt your data first:

dfm <- melt(df, id = "date", measure = c("theta","vega","delta")) qplot(date, value, data=dfm, geom="line", colour = variable)

Hadley

On Tue, Jul 22, 2008 at 6:05 PM, R_Learner <sschiang8_at_gmail.com> wrote:
>
> Hi,
> I'm trying to plot multiple lines on one plot. I have a data frame raw,
> and i want to plot raw$date on the x-axis and raw$theta, raw$vega,
> raw$delta, and a few others on the y-axis, with a legend. However, I'm not
> sure what the scale of those data sets are, and I don't know which one will
> have the largest scale. How can I plot this? I've tried ggplot (qplot), but
> it doesn't seem to be capable of multiple lines.
>
> Thanks!
> --
> View this message in context: http://www.nabble.com/Plotting-Multiple-lines-on-one-plot-tp18600665p18600665.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

-- 
http://had.co.nz/

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Wed 23 Jul 2008 - 15:34:29 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 23 Jul 2008 - 16:32:10 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive