Forums | Admin

Discussion Forums: help

Start New Thread Start New Thread

 

By: Ray Chang
RE: Plotting Multiple Datasets [ reply ]  
2009-07-16 06:07
Wow, that was fast!

Thanks for the quick response.

I love the internet

-Ray

By: Adrian Schoenig
RE: Plotting Multiple Datasets [ reply ]  
2009-07-16 05:46
"RSRuby.instance.plot ..." creates the whole graph. If you wanna add
something to the graph, you just need to call "RSRuby.instance.line
..." afterwards and this will get added to your graph. So just replace your second @@r.plot with @@r.line. That easy!

Adrian

By: Ray Chang
Plotting Multiple Datasets [ reply ]  
2009-07-16 05:38
I am a complete noob when it comes to using R.

I am successful at plotting a single dataset, but I can't seem to be able to plot two.

I found:
http://cran.r-project.org/doc/contrib/Lemon-kickstart/kr_addat.html and have tried multiple combinations of some of the directives but no dice.

Can somebody shed some light on this?


@@r = RSRuby.instance
@@r.png("sample.png")
@@r.plot([1,2,3], [1,2,3],
:xlab => "x label", :ylab => "y label",
:type => "p", :main => "Simple graph",
:col => "blue")
@@r.plot([5,6,7],[5,6,7], :type => 'b', :col => 3)

@@r.eval_R("dev.off()")

Thanks.

-Ray