Re: [R] Pointing to a specific place on the x-axis with an arrow
On Wed, Oct 6, 2010 at 1:45 AM, Josh B josh...@yahoo.com wrote: Hi all, I am trying to do something simple, but which is deviling me. I want to add an up-arrow to the x-axis, pointing to a specific location on the axis. I want the arrow to be as large as possible. Here is where I'm at with my code: #this part if from the ?plot example: require(stats) plot(cars) lines(lowess(cars)) #I am trying to use mtext to add the arrow... but I don't know how to do it: mtext(?, side = 1, line = 0, at = 7) #that question mark is a place-holder for the arrow. How do I put an up-arrow there instead of the question mark -- as large as possible? Use %up% in an expression - but I think it needs two empty {} expressions as arguments: mtext(expression({}%up%{}), side = 1, line = 0, at = 12) Looks pretty good... Barry -- blog: http://geospaced.blogspot.com/ web: http://www.maths.lancs.ac.uk/~rowlings web: http://www.rowlingson.com/ twitter: http://twitter.com/geospacedman pics: http://www.flickr.com/photos/spacedman __ R-help@r-project.org 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.
Re: [R] Pointing to a specific place on the x-axis with an arrow
Hi Josh, Try this... mtext(expression(symbol(\255)), side=1, line=0, at=7) Michael On 6 October 2010 11:45, Josh B josh...@yahoo.com wrote: Hi all, I am trying to do something simple, but which is deviling me. I want to add an up-arrow to the x-axis, pointing to a specific location on the axis. I want the arrow to be as large as possible. Here is where I'm at with my code: #this part if from the ?plot example: require(stats) plot(cars) lines(lowess(cars)) #I am trying to use mtext to add the arrow... but I don't know how to do it: mtext(?, side = 1, line = 0, at = 7) #that question mark is a place-holder for the arrow. How do I put an up-arrow there instead of the question mark -- as large as possible? Many thanks to all of you in advance. --- Josh Banta, Ph.D Center for Genomics and Systems Biology New York University 100 Washington Square East New York, NY 10003 Tel: (212) 998-8465 http://plantevolutionaryecology.org [[alternative HTML version deleted]] __ R-help@r-project.org 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. __ R-help@r-project.org 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.
Re: [R] Pointing to a specific place on the x-axis with an arrow
Hi Michael, I'm just curious if you know about a list somewhere where I can find the number of a specific symbol. What I mean, with your example, is how to find that an arrow corresponds to \255. Moreover, Josh wanted the arrow to be really big. Is it possible to make it bigger? I would be interested too! Thanks, Ivan Le 10/6/2010 11:09, Michael Bedward a écrit : Hi Josh, Try this... mtext(expression(symbol(\255)), side=1, line=0, at=7) Michael On 6 October 2010 11:45, Josh Bjosh...@yahoo.com wrote: Hi all, I am trying to do something simple, but which is deviling me. I want to add an up-arrow to the x-axis, pointing to a specific location on the axis. I want the arrow to be as large as possible. Here is where I'm at with my code: #this part if from the ?plot example: require(stats) plot(cars) lines(lowess(cars)) #I am trying to use mtext to add the arrow... but I don't know how to do it: mtext(?, side = 1, line = 0, at = 7) #that question mark is a place-holder for the arrow. How do I put an up-arrow there instead of the question mark -- as large as possible? Many thanks to all of you in advance. --- Josh Banta, Ph.D Center for Genomics and Systems Biology New York University 100 Washington Square East New York, NY 10003 Tel: (212) 998-8465 http://plantevolutionaryecology.org [[alternative HTML version deleted]] __ R-help@r-project.org 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. __ R-help@r-project.org 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. -- Ivan CALANDRA PhD Student University of Hamburg Biozentrum Grindel und Zoologisches Museum Abt. Säugetiere Martin-Luther-King-Platz 3 D-20146 Hamburg, GERMANY +49(0)40 42838 6231 ivan.calan...@uni-hamburg.de ** http://www.for771.uni-bonn.de http://webapp5.rrz.uni-hamburg.de/mammals/eng/mitarbeiter.php [[alternative HTML version deleted]] __ R-help@r-project.org 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.
Re: [R] Pointing to a specific place on the x-axis with an arrow
Hi Ivan, The help page for plotmath has a list of symbol names such as the one Barry suggested, and in the References section there is a URL (the auckland.ac.nz one) for a table of symbols and their numeric codes. Michael On 6 October 2010 20:51, Ivan Calandra ivan.calan...@uni-hamburg.de wrote: Hi Michael, I'm just curious if you know about a list somewhere where I can find the number of a specific symbol. What I mean, with your example, is how to find that an arrow corresponds to \255. Moreover, Josh wanted the arrow to be really big. Is it possible to make it bigger? I would be interested too! Thanks, Ivan Le 10/6/2010 11:09, Michael Bedward a écrit : Hi Josh, Try this... mtext(expression(symbol(\255)), side=1, line=0, at=7) Michael On 6 October 2010 11:45, Josh Bjosh...@yahoo.com wrote: Hi all, I am trying to do something simple, but which is deviling me. I want to add an up-arrow to the x-axis, pointing to a specific location on the axis. I want the arrow to be as large as possible. Here is where I'm at with my code: #this part if from the ?plot example: require(stats) plot(cars) lines(lowess(cars)) #I am trying to use mtext to add the arrow... but I don't know how to do it: mtext(?, side = 1, line = 0, at = 7) #that question mark is a place-holder for the arrow. How do I put an up-arrow there instead of the question mark -- as large as possible? Many thanks to all of you in advance. --- Josh Banta, Ph.D Center for Genomics and Systems Biology New York University 100 Washington Square East New York, NY 10003 Tel: (212) 998-8465 http://plantevolutionaryecology.org [[alternative HTML version deleted]] __ R-help@r-project.org 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. __ R-help@r-project.org 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. -- Ivan CALANDRA PhD Student University of Hamburg Biozentrum Grindel und Zoologisches Museum Abt. Säugetiere Martin-Luther-King-Platz 3 D-20146 Hamburg, GERMANY +49(0)40 42838 6231 ivan.calan...@uni-hamburg.de ** http://www.for771.uni-bonn.de http://webapp5.rrz.uni-hamburg.de/mammals/eng/mitarbeiter.php [[alternative HTML version deleted]] __ R-help@r-project.org 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. __ R-help@r-project.org 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.
Re: [R] Pointing to a specific place on the x-axis with an arrow
On Oct 6, 2010, at 5:09 AM, Michael Bedward wrote: Hi Josh, Try this... mtext(expression(symbol(\255)), side=1, line=0, at=7) For both Rowlingsons's and Bedward's solutions the request for as large as possible can be addressed with cex = 5 or some more suitable value. -- David. Michael On 6 October 2010 11:45, Josh B josh...@yahoo.com wrote: Hi all, I am trying to do something simple, but which is deviling me. I want to add an up-arrow to the x-axis, pointing to a specific location on the axis. I want the arrow to be as large as possible. Here is where I'm at with my code: #this part if from the ?plot example: require(stats) plot(cars) lines(lowess(cars)) #I am trying to use mtext to add the arrow... but I don't know how to do it: mtext(?, side = 1, line = 0, at = 7) #that question mark is a place-holder for the arrow. How do I put an up-arrow there instead of the question mark -- as large as possible? Many thanks to all of you in advance. --- Josh Banta, Ph.D Center for Genomics and Systems Biology New York University 100 Washington Square East New York, NY 10003 Tel: (212) 998-8465 http://plantevolutionaryecology.org [[alternative HTML version deleted]] __ R-help@r-project.org 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. __ R-help@r-project.org 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. David Winsemius, MD West Hartford, CT __ R-help@r-project.org 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.
Re: [R] Pointing to a specific place on the x-axis with an arrow
On 6 October 2010 20:51, Ivan Calandra ivan.calan...@uni-hamburg.de wrote: Moreover, Josh wanted the arrow to be really big. Is it possible to make it bigger? I would be interested too! Sorry - missed that bit. You can use the cex argument of the mtext function to make the symbol bigger. Michael __ R-help@r-project.org 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.
Re: [R] Pointing to a specific place on the x-axis with an arrow
On Wed, Oct 6, 2010 at 11:04 AM, Michael Bedward michael.bedw...@gmail.com wrote: On 6 October 2010 20:51, Ivan Calandra ivan.calan...@uni-hamburg.de wrote: Moreover, Josh wanted the arrow to be really big. Is it possible to make it bigger? I would be interested too! Sorry - missed that bit. You can use the cex argument of the mtext function to make the symbol bigger. And you might also need 'line=' to shift it down a bit once it starts growing. If all else fails, use arrows() - but that might get tricky... plot(1:10) par(xpd=NA) # dont clip to the plot arrows(5,0,5,1) You could use various other par() options to get the position of the axis... plot(2:20) par(xpd=NA) arrows(7,par()$usr[3]-3,7,par()$usr[3],lwd=2) Barry __ R-help@r-project.org 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.
Re: [R] Pointing to a specific place on the x-axis with an arrow
Hi again, Just one little question. I don't understand what clipping is. Probably a problem with English... Therefore the par(xpd=NA) is not really clear for me; nor is the clip() function. And I don't see any difference between par(xpd=NA) and nothing. It's not really related to this post, let me know if I should change the subject. Thanks, Ivan Le 10/6/2010 13:05, Barry Rowlingson a écrit : On Wed, Oct 6, 2010 at 11:04 AM, Michael Bedward michael.bedw...@gmail.com wrote: On 6 October 2010 20:51, Ivan Calandraivan.calan...@uni-hamburg.de wrote: Moreover, Josh wanted the arrow to be really big. Is it possible to make it bigger? I would be interested too! Sorry - missed that bit. You can use the cex argument of the mtext function to make the symbol bigger. And you might also need 'line=' to shift it down a bit once it starts growing. If all else fails, use arrows() - but that might get tricky... plot(1:10) par(xpd=NA) # dont clip to the plot arrows(5,0,5,1) You could use various other par() options to get the position of the axis... plot(2:20) par(xpd=NA) arrows(7,par()$usr[3]-3,7,par()$usr[3],lwd=2) Barry -- Ivan CALANDRA PhD Student University of Hamburg Biozentrum Grindel und Zoologisches Museum Abt. Säugetiere Martin-Luther-King-Platz 3 D-20146 Hamburg, GERMANY +49(0)40 42838 6231 ivan.calan...@uni-hamburg.de ** http://www.for771.uni-bonn.de http://webapp5.rrz.uni-hamburg.de/mammals/eng/mitarbeiter.php [[alternative HTML version deleted]] __ R-help@r-project.org 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.
Re: [R] Pointing to a specific place on the x-axis with an arrow
On Wed, Oct 6, 2010 at 12:29 PM, Ivan Calandra ivan.calan...@uni-hamburg.de wrote: Hi again, Just one little question. I don't understand what clipping is. Probably a problem with English... Therefore the par(xpd=NA) is not really clear for me; nor is the clip() function. And I don't see any difference between par(xpd=NA) and nothing. It's not really related to this post, let me know if I should change the subject. Try this: par(xpd=FALSE) plot(1:10) abline(h=4) par(xpd=NA) abline(h=5) the first horizontal line, at y=4, should only be visible in the box of the plot. The second line, at y=5, should go right across the graphics window. We say the first line is 'clipped' to the box. so, to draw some things outside the box you have to set par(xpd=NA) first. Its not necessary with things like mtext and axis because they obviously are going to draw outside the box anyway. It's just for points, lines, symbols, arrows etc. Barry __ R-help@r-project.org 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.
Re: [R] Pointing to a specific place on the x-axis with an arrow
Thanks for the great example and explanation! Ivan Le 10/6/2010 15:06, Barry Rowlingson a écrit : On Wed, Oct 6, 2010 at 12:29 PM, Ivan Calandra ivan.calan...@uni-hamburg.de wrote: Hi again, Just one little question. I don't understand what clipping is. Probably a problem with English... Therefore the par(xpd=NA) is not really clear for me; nor is the clip() function. And I don't see any difference between par(xpd=NA) and nothing. It's not really related to this post, let me know if I should change the subject. Try this: par(xpd=FALSE) plot(1:10) abline(h=4) par(xpd=NA) abline(h=5) the first horizontal line, at y=4, should only be visible in the box of the plot. The second line, at y=5, should go right across the graphics window. We say the first line is 'clipped' to the box. so, to draw some things outside the box you have to set par(xpd=NA) first. Its not necessary with things like mtext and axis because they obviously are going to draw outside the box anyway. It's just for points, lines, symbols, arrows etc. Barry -- Ivan CALANDRA PhD Student University of Hamburg Biozentrum Grindel und Zoologisches Museum Abt. Säugetiere Martin-Luther-King-Platz 3 D-20146 Hamburg, GERMANY +49(0)40 42838 6231 ivan.calan...@uni-hamburg.de ** http://www.for771.uni-bonn.de http://webapp5.rrz.uni-hamburg.de/mammals/eng/mitarbeiter.php [[alternative HTML version deleted]] __ R-help@r-project.org 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.
Re: [R] Pointing to a specific place on the x-axis with an arrow
Dear Michael, Thanks very much. I have a follow-up question: how did you know that symbol 255 is the up-arrow? Josh From: Michael Bedward michael.bedw...@gmail.com Cc: R Help r-help@r-project.org Sent: Wed, October 6, 2010 5:09:48 AM Subject: Re: [R] Pointing to a specific place on the x-axis with an arrow Hi Josh, Try this... mtext(expression(symbol(\255)), side=1, line=0, at=7) Michael Hi all, I am trying to do something simple, but which is deviling me. I want to add an up-arrow to the x-axis, pointing to a specific location on the axis. I want the arrow to be as large as possible. Here is where I'm at with my code: #this part if from the ?plot example: require(stats) plot(cars) lines(lowess(cars)) #I am trying to use mtext to add the arrow... but I don't know how to do it: mtext(?, side = 1, line = 0, at = 7) #that question mark is a place-holder for the arrow. How do I put an up-arrow there instead of the question mark -- as large as possible? Many thanks to all of you in advance. --- Josh Banta, Ph.D Center for Genomics and Systems Biology New York University 100 Washington Square East New York, NY 10003 Tel: (212) 998-8465 http://plantevolutionaryecology.org [[alternative HTML version deleted]] __ R-help@r-project.org 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. [[alternative HTML version deleted]] __ R-help@r-project.org 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.
Re: [R] Pointing to a specific place on the x-axis with an arrow
On Oct 6, 2010, at 9:03 AM, Josh B wrote: Dear Michael, Thanks very much. I have a follow-up question: how did you know that symbol 255 is the up-arrow? ?plomath # includes reference to : http://www.stat.auckland.ac.nz/~paul/R/CM/AdobeSym.html Josh From: Michael Bedward michael.bedw...@gmail.com Cc: R Help r-help@r-project.org Sent: Wed, October 6, 2010 5:09:48 AM Subject: Re: [R] Pointing to a specific place on the x-axis with an arrow Hi Josh, Try this... mtext(expression(symbol(\255)), side=1, line=0, at=7) Michael Hi all, I am trying to do something simple, but which is deviling me. I want to add an up-arrow to the x-axis, pointing to a specific location on the axis. I want the arrow to be as large as possible. Here is where I'm at with my code: #this part if from the ?plot example: require(stats) plot(cars) lines(lowess(cars)) #I am trying to use mtext to add the arrow... but I don't know how to do it: mtext(?, side = 1, line = 0, at = 7) #that question mark is a place-holder for the arrow. How do I put an up-arrow there instead of the question mark -- as large as possible? Many thanks to all of you in advance. --- Josh Banta, Ph.D Center for Genomics and Systems Biology New York University __ R-help@r-project.org 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.
Re: [R] Pointing to a specific place on the x-axis with an arrow
Not sure which ones work in R, but I recently needed injection, surjection,and bijection arrows, and found them here : http://unicode.org/charts/#symbols HTH, David L. Reiner, PhD Head Quant XR Trading LLC -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of David Winsemius Sent: Wednesday, October 06, 2010 9:05 AM To: Josh B Cc: R Help Subject: Re: [R] Pointing to a specific place on the x-axis with an arrow On Oct 6, 2010, at 9:03 AM, Josh B wrote: Dear Michael, Thanks very much. I have a follow-up question: how did you know that symbol 255 is the up-arrow? ?plomath # includes reference to : http://www.stat.auckland.ac.nz/~paul/R/CM/AdobeSym.html Josh From: Michael Bedward michael.bedw...@gmail.com Cc: R Help r-help@r-project.org Sent: Wed, October 6, 2010 5:09:48 AM Subject: Re: [R] Pointing to a specific place on the x-axis with an arrow Hi Josh, Try this... mtext(expression(symbol(\255)), side=1, line=0, at=7) Michael Hi all, I am trying to do something simple, but which is deviling me. I want to add an up-arrow to the x-axis, pointing to a specific location on the axis. I want the arrow to be as large as possible. Here is where I'm at with my code: #this part if from the ?plot example: require(stats) plot(cars) lines(lowess(cars)) #I am trying to use mtext to add the arrow... but I don't know how to do it: mtext(?, side = 1, line = 0, at = 7) #that question mark is a place-holder for the arrow. How do I put an up-arrow there instead of the question mark -- as large as possible? Many thanks to all of you in advance. --- Josh Banta, Ph.D Center for Genomics and Systems Biology New York University __ R-help@r-project.org 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. This e-mail and any materials attached hereto, including, without limitation, all content hereof and thereof (collectively, XR Content) are confidential and proprietary to XR Trading, LLC (XR) and/or its affiliates, and are protected by intellectual property laws. Without the prior written consent of XR, the XR Content may not (i) be disclosed to any third party or (ii) be reproduced or otherwise used by anyone other than current employees of XR or its affiliates, on behalf of XR or its affiliates. THE XR CONTENT IS PROVIDED AS IS, WITHOUT REPRESENTATIONS OR WARRANTIES OF ANY KIND. TO THE MAXIMUM EXTENT PERMISSIBLE UNDER APPLICABLE LAW, XR HEREBY DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS AND IMPLIED, RELATING TO THE XR CONTENT, AND NEITHER XR NOR ANY OF ITS AFFILIATES SHALL IN ANY EVENT BE LIABLE FOR ANY DAMAGES OF ANY NATURE WHATSOEVER, INCLUDING, BUT NOT LIMITED TO, DIRECT, INDIRECT, CONSEQUENTIAL, SPECIAL AND PUNITIVE DAMAGES, LOSS OF PROFITS AND TRADING LOSSES, RESULTING FROM ANY PERSON'S USE OR RELIANCE UPON, OR INABILITY TO USE, ANY XR CONTENT, EVEN IF XR IS ADVISED OF THE POSSIBILITY OF SUCH DAMAGES OR IF SUCH DAMAGES WERE FORESEEABLE. __ R-help@r-project.org 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.