An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20111031/5e41c7d7/attachment.pl>
3 Overlayed simple plots
4 messages · Alaios, Rolf Turner, Paul Hiemstra +1 more
On 31/10/11 21:13, Alaios wrote:
Dear all,
I am plotting 3 plots into the same x and y axis.
I want the first one to be painted red with a continuous line
The second one green with a continuous line
and the third one blue with a continuous line
plot(max_power(data),ylim=c(-120,-20))
par(new=T)
plot(min_power(data),ylim=c(-120,-20))
par(new=T)
plot(mean_power(data),ylim=c(-120,-20))
par(new=F)
Is it also a way to do that look more nice instead of having 6 lines of code?
?lines
cheers,
Rolf Turner
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20111031/7854c855/attachment.pl>
On Mon, Oct 31, 2011 at 8:54 AM, Rolf Turner <rolf.turner at xtra.co.nz> wrote:
On 31/10/11 21:13, Alaios wrote:
Dear all, I am plotting 3 plots into the same x and y axis. I want the first one to be painted red with a continuous line The second one green with a continuous line and the third one blue with a continuous line plot(max_power(data),ylim=c(-120,-20)) ? ? par(new=T) ? ? plot(min_power(data),ylim=c(-120,-20)) ? ? par(new=T) ? ? plot(mean_power(data),ylim=c(-120,-20)) ? ? par(new=F) Is it also a way to do that look more nice instead of having 6 lines of code?
?lines
Or help(matplot). Stick your data in a matrix. Choose colours. Choose lines. Choose a number of line styles or widths. I chose not to choose lines. I chose something else. I chose ggplot. [with apologies to Ewan McGregor's opening monologue in Trainspotting] Barry