axis thickness in plot()

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

axis thickness in plot()

AlexC
Hello,

I am trying to increase the thickness of the axis in plot() without reverting to the use of paint programs

i see posts on that topic for the xyplot function but want to see if i can do it with plot() because i've already setup my graph script using that

i thought i could use axis() function and specify lwd="thickness" or lwd.axis= but that does not work like it does for lwd.ticks

If anyone has an idea, sincerely

heres the script

windows(width=7,height=7)
plot(data$Winter,data$NbFirstBroods,ylab="number of breeding pairs",xlab="winter harshness",cex=1.5,cex.lab=1.5,cex.axis=1.5,font.axis=2,axes=FALSE)
points(data$Winter,data$NbFirstBroods,cex=1.5,col="black",pch=19)
abline(lm(data$NbFirstBroods~data$Winter),col="red",lwd=4)

i tried axis(1, lwd.axis = 3,lwd.ticks=3) for example

also when adding the y axis axis(2...) x and y axes are disconnected

Thank you for your kind help in advance,

Alexandre
Reply | Threaded
Open this post in threaded view
|

Re: axis thickness in plot()

Peter Ehlers
On 2011-12-06 08:35, AlexC wrote:

> Hello,
>
> I am trying to increase the thickness of the axis in plot() without
> reverting to the use of paint programs
>
> i see posts on that topic for the xyplot function but want to see if i can
> do it with plot() because i've already setup my graph script using that
>
> i thought i could use axis() function and specify lwd="thickness" or
> lwd.axis= but that does not work like it does for lwd.ticks
>
> If anyone has an idea, sincerely
>
> heres the script
>
> windows(width=7,height=7)
> plot(data$Winter,data$NbFirstBroods,ylab="number of breeding
> pairs",xlab="winter
> harshness",cex=1.5,cex.lab=1.5,cex.axis=1.5,font.axis=2,axes=FALSE)
> points(data$Winter,data$NbFirstBroods,cex=1.5,col="black",pch=19)
> abline(lm(data$NbFirstBroods~data$Winter),col="red",lwd=4)

Only you have the object you call 'data'. Why not provide a
simple example (reproducible and minus the obviously unnecessary
annotation) that illustrates your problem?

>
> i tried axis(1, lwd.axis = 3,lwd.ticks=3) for example

Presumably this gave a warning: "lwd.axis" is not a graphical parameter.
The best thing at that point (if not sooner), is to type ?axis to
see what the arguments for that function are. This would immediately
show that 'lwd' is the argument you want.

>
> also when adding the y axis axis(2...) x and y axes are disconnected

Use box() with your choice of bty and lwd. If you want different
linewidths for the x and y axes, then retrieve the coordinates of
par("usr") and use either abline() or lines().

Peter Ehlers

>
> Thank you for your kind help in advance,
>
> Alexandre
>
> --
> View this message in context: http://r.789695.n4.nabble.com/axis-thickness-in-plot-tp4165430p4165430.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: axis thickness in plot()

AlexC
RESOLVED
dear Peter
thank you for your quick response

naturally, I was trying lwd before using lwd.axis, the only reason i tried lwd.axis is because lwd wasn't working yesterday.  I restarted R today and for some reason the exact same script, with the lwd argument, that gave me the lwd error yesterday is working

Sincerely,

Alexandre C.

Reply | Threaded
Open this post in threaded view
|

Re: axis thickness in plot()

Greg Snow-2
In reply to this post by AlexC
Often when someone wants lines (axes) in R plots to be thicker or thinner it is because they are producing the plots at the wrong size, then changing the size of the plot in some other program (like MSword) and the lines do not look as nice.  If this is your case, then the better approach is to produce the original graph at the appropriate size, then you don't need to worry about the effects of resizing.

--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
[hidden email]
801.408.8111


> -----Original Message-----
> From: [hidden email] [mailto:r-help-bounces@r-
> project.org] On Behalf Of AlexC
> Sent: Tuesday, December 06, 2011 9:35 AM
> To: [hidden email]
> Subject: [R] axis thickness in plot()
>
> Hello,
>
> I am trying to increase the thickness of the axis in plot() without
> reverting to the use of paint programs
>
> i see posts on that topic for the xyplot function but want to see if i
> can
> do it with plot() because i've already setup my graph script using that
>
> i thought i could use axis() function and specify lwd="thickness" or
> lwd.axis= but that does not work like it does for lwd.ticks
>
> If anyone has an idea, sincerely
>
> heres the script
>
> windows(width=7,height=7)
> plot(data$Winter,data$NbFirstBroods,ylab="number of breeding
> pairs",xlab="winter
> harshness",cex=1.5,cex.lab=1.5,cex.axis=1.5,font.axis=2,axes=FALSE)
> points(data$Winter,data$NbFirstBroods,cex=1.5,col="black",pch=19)
> abline(lm(data$NbFirstBroods~data$Winter),col="red",lwd=4)
>
> i tried axis(1, lwd.axis = 3,lwd.ticks=3) for example
>
> also when adding the y axis axis(2...) x and y axes are disconnected
>
> Thank you for your kind help in advance,
>
> Alexandre
>
> --
> View this message in context: http://r.789695.n4.nabble.com/axis-
> thickness-in-plot-tp4165430p4165430.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.