Ajdustment of data symbols

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

Ajdustment of data symbols

Giovanni Petris

Hello,

Is there a way to specify a non-default adjustment for data symbols, similar to what "adj" does for text?

For example, the following lines of code produce a red triangle on the bottom border of the plot:

plot(0, 0, type = 'n', xlab = "", ylab = "")
points(0.25, par("usr")[3], pch = 17, col = "red", cex = 2, xpd = TRUE)

I would like to draw the triangle completely outside the plotting area, with the upper vertex touching the x-axis...

Thank you in advance!

Best,
Giovanni



--
Giovanni Petris, PhD
Professor
Director of Statistics
Department of Mathematical Sciences
University of Arkansas - Fayetteville, AR 72701
Ph: (479) 575-6324, 575-8630 (fax)
http://definetti.uark.edu/


______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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: Ajdustment of data symbols

David Carlson
Try this. The par("cxy") gets a vector of character width and height in user coordinates.

points(0.25, par("usr")[3]-par("cxy")[2]/2, pch = 17, col = "red", cex = 2, xpd = TRUE)

-------------------------------------
David L Carlson
Department of Anthropology
Texas A&M University
College Station, TX 77840-4352

-----Original Message-----
From: R-help [mailto:[hidden email]] On Behalf Of Giovanni Petris
Sent: Thursday, December 1, 2016 10:01 AM
To: [hidden email]
Cc: Giovanni Petris
Subject: [R] Ajdustment of data symbols


Hello,

Is there a way to specify a non-default adjustment for data symbols, similar to what "adj" does for text?

For example, the following lines of code produce a red triangle on the bottom border of the plot:

plot(0, 0, type = 'n', xlab = "", ylab = "")
points(0.25, par("usr")[3], pch = 17, col = "red", cex = 2, xpd = TRUE)

I would like to draw the triangle completely outside the plotting area, with the upper vertex touching the x-axis...

Thank you in advance!

Best,
Giovanni



--
Giovanni Petris, PhD
Professor
Director of Statistics
Department of Mathematical Sciences
University of Arkansas - Fayetteville, AR 72701
Ph: (479) 575-6324, 575-8630 (fax)
http://definetti.uark.edu/


______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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 -- To UNSUBSCRIBE and more, see
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: Ajdustment of data symbols

Giovanni Petris

That's exactly what I was looking for!

Thank you,
Giovanni

________________________________________
From: David L Carlson <[hidden email]>
Sent: Thursday, December 1, 2016 10:18
To: Giovanni Petris; [hidden email]
Subject: RE: Ajdustment of data symbols

Try this. The par("cxy") gets a vector of character width and height in user coordinates.

points(0.25, par("usr")[3]-par("cxy")[2]/2, pch = 17, col = "red", cex = 2, xpd = TRUE)

-------------------------------------
David L Carlson
Department of Anthropology
Texas A&M University
College Station, TX 77840-4352

-----Original Message-----
From: R-help [mailto:[hidden email]] On Behalf Of Giovanni Petris
Sent: Thursday, December 1, 2016 10:01 AM
To: [hidden email]
Cc: Giovanni Petris
Subject: [R] Ajdustment of data symbols


Hello,

Is there a way to specify a non-default adjustment for data symbols, similar to what "adj" does for text?

For example, the following lines of code produce a red triangle on the bottom border of the plot:

plot(0, 0, type = 'n', xlab = "", ylab = "")
points(0.25, par("usr")[3], pch = 17, col = "red", cex = 2, xpd = TRUE)

I would like to draw the triangle completely outside the plotting area, with the upper vertex touching the x-axis...

Thank you in advance!

Best,
Giovanni



--
Giovanni Petris, PhD
Professor
Director of Statistics
Department of Mathematical Sciences
University of Arkansas - Fayetteville, AR 72701
Ph: (479) 575-6324, 575-8630 (fax)
http://definetti.uark.edu/


______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://urldefense.proofpoint.com/v2/url?u=https-3A__stat.ethz.ch_mailman_listinfo_r-2Dhelp&d=DgIFAg&c=7ypwAowFJ8v-mw8AB-SdSueVQgSDL4HiiSaLK01W8HA&r=C3DNvy_azplKSvJKgvsgjA&m=eJAlQ1Qalin1IVzkWmqtiDeAOsMhi2ionhGq4KT4u7g&s=SkVbrPUxN4YKUKSG8tTpDTqYcf8VixPuh9HHA38yCuo&e=
PLEASE do read the posting guide https://urldefense.proofpoint.com/v2/url?u=http-3A__www.R-2Dproject.org_posting-2Dguide.html&d=DgIFAg&c=7ypwAowFJ8v-mw8AB-SdSueVQgSDL4HiiSaLK01W8HA&r=C3DNvy_azplKSvJKgvsgjA&m=eJAlQ1Qalin1IVzkWmqtiDeAOsMhi2ionhGq4KT4u7g&s=jW3W6tyyH73FqGxaGgFKnmreBfxV0cwwV9dw0o0gdPc&e=
and provide commented, minimal, self-contained, reproducible code.

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.