how to make plot lines thicker

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

how to make plot lines thicker

peziza
I am trying to make the lines thicker in a graph (for a ppt presentation).

Here is what I currently have:

plot(x,y,type="l", ylab="Number of OTUs", xlab="Number of Samples Collected", col="Black", pch=1, ylim=c(0,6000))

points(x, Sobs$Chao_1_Mean, type="l", col="Gray", pch=1) (this is one of the added lines in the graph).

I believe cex can help increase the size of the points. But I haven't been able to get it to work.
Reply | Threaded
Open this post in threaded view
|

Re: how to make plot lines thicker

Sarah Goslee
I'd suggest using lines() rather than points() to add lines to a plot.
The parameter to change line width is lwd rather than cex.

e.g.
lines(x, Sobs$Chao_1_Mean, col="Gray", lwd=2)

Reading ?par can be both an enlightening and confusing experience.

Sarah

On Mon, Jul 9, 2012 at 1:11 PM, peziza <[hidden email]> wrote:

> I am trying to make the lines thicker in a graph (for a ppt presentation).
>
> Here is what I currently have:
>
> plot(x,y,type="l", ylab="Number of OTUs", xlab="Number of Samples
> Collected", col="Black", pch=1, ylim=c(0,6000))
>
> points(x, Sobs$Chao_1_Mean, type="l", col="Gray", pch=1) (this is one of the
> added lines in the graph).
>
> I believe cex can help increase the size of the points. But I haven't been
> able to get it to work.
>
>

--
Sarah Goslee
http://www.functionaldiversity.org

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: how to make plot lines thicker

John Kane
In reply to this post by peziza
?par and have a look at lwd

John Kane
Kingston ON Canada


> -----Original Message-----
> From: [hidden email]
> Sent: Mon, 9 Jul 2012 10:11:32 -0700 (PDT)
> To: [hidden email]
> Subject: [R] how to make plot lines thicker
>
> I am trying to make the lines thicker in a graph (for a ppt
> presentation).
>
> Here is what I currently have:
>
> plot(x,y,type="l", ylab="Number of OTUs", xlab="Number of Samples
> Collected", col="Black", pch=1, ylim=c(0,6000))
>
> points(x, Sobs$Chao_1_Mean, type="l", col="Gray", pch=1) (this is one of
> the
> added lines in the graph).
>
> I believe cex can help increase the size of the points. But I haven't
> been
> able to get it to work.
>
>
> --
> View this message in context:
> http://r.789695.n4.nabble.com/how-to-make-plot-lines-thicker-tp4635875.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> [hidden email] 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.

____________________________________________________________
FREE 3D EARTH SCREENSAVER - Watch the Earth right on your desktop!

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: how to make plot lines thicker

Michael Weylandt
In reply to this post by peziza
These sorts of parameters are all documented under ?par, but it's a
bit of a beast to read. The one you are looking for is lwd=

To wit

layout(1:2)
plot(1:5, type = "l")
plot(1:5, type = "l", lwd = 3)

Best,
Michael

On Mon, Jul 9, 2012 at 12:11 PM, peziza <[hidden email]> wrote:

> I am trying to make the lines thicker in a graph (for a ppt presentation).
>
> Here is what I currently have:
>
> plot(x,y,type="l", ylab="Number of OTUs", xlab="Number of Samples
> Collected", col="Black", pch=1, ylim=c(0,6000))
>
> points(x, Sobs$Chao_1_Mean, type="l", col="Gray", pch=1) (this is one of the
> added lines in the graph).
>
> I believe cex can help increase the size of the points. But I haven't been
> able to get it to work.
>
>
> --
> View this message in context: http://r.789695.n4.nabble.com/how-to-make-plot-lines-thicker-tp4635875.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> [hidden email] 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.

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: how to make plot lines thicker

peziza
Thanks, that worked!