I'm trying to draw an arrow with a curved shaft on the graph as a straight one looks messy on a detailed graph. I've looked in arrows but it doesn't seem to give an option. larrows doesn't look much more promising. I had a look in the archive and couldn't find anything. Any thoughts?
Thanks Paul |
Paul,
there might be other solutions as well, but there is an internal function in the igraph package that can draw curved arrows, it is called igraph:::igraph.Arrows(). As it is an internal function, it is not documented, but I think it is pretty straightforward to use. For the 'curved' argument you can give a number, try values between 0 and 1, or (if I remember well) -1 and 0 if you want it to curve towards the opposite side. Best, Gabor On Thu, Apr 30, 2009 at 10:57 AM, Paul Chatfield <[hidden email]> wrote: > > I'm trying to draw an arrow with a curved shaft on the graph as a straight > one looks messy on a detailed graph. I've looked in arrows but it doesn't > seem to give an option. larrows doesn't look much more promising. I had a > look in the archive and couldn't find anything. Any thoughts? > > Thanks > > Paul > -- > View this message in context: http://www.nabble.com/Curved-arrows-tp23312316p23312316.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. > -- Gabor Csardi <[hidden email]> UNIL DGM ______________________________________________ [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. |
In reply to this post by Paul Chatfield-3
On Thu, Apr 30, 2009 at 2:37 PM, <[hidden email]> wrote:
> Hey - I tried this without success. The igraph doesn't work with R 2.9.0, That is strange, why not? > so I'm using it with the 2.8.0 version which is the previous one I had. Can you write a simple code that would put an arrow with a curved shaft on, e.g > plot(3,5) > igraph.Arrows(3,4,4,5) Exactly like this, but the function is not exported, and you need the 'curved' argument: plot(3,5) igraph:::igraph.Arrows(3,4,4,5) igraph:::igraph.Arrows(3,4,4,5, curved=TRUE) igraph:::igraph.Arrows(3,4,4,5, curved=-0.5) igraph:::igraph.Arrows(3,4,4,5, curved=-1) igraph:::igraph.Arrows(3,4,4,5, curved=1) You need igraph version 0.5.2 for this I think. Type head(igraph:::igraph.Arrows) to see the other arguments to play with. Gabor > Thanks for your quick reply before that was much appreciated, > > Paul > > Gábor Csárdi-2 wrote: >> >> Paul, >> >> there might be other solutions as well, but there is an internal >> function in the igraph package that can draw curved arrows, it is >> called igraph:::igraph.Arrows(). As it is an internal function, it is >> not documented, but I think it is pretty straightforward to use. For >> the 'curved' argument you can give a number, try values between 0 and >> 1, or (if I remember well) -1 and 0 if you want it to curve towards >> the opposite side. >> >> Best, >> Gabor >> >> On Thu, Apr 30, 2009 at 10:57 AM, Paul Chatfield >> <[hidden email]> wrote: >>> >>> I'm trying to draw an arrow with a curved shaft on the graph as a >>> straight >>> one looks messy on a detailed graph. I've looked in arrows but it >>> doesn't >>> seem to give an option. larrows doesn't look much more promising. I had >>> a >>> look in the archive and couldn't find anything. Any thoughts? >>> >>> Thanks >>> >>> Paul >>> -- >>> View this message in context: >>> http://www.nabble.com/Curved-arrows-tp23312316p23312316.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. >>> >> >> >> >> -- >> Gabor Csardi <[hidden email]> UNIL DGM >> >> ______________________________________________ >> [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. >> >> > Quoted from: http://www.nabble.com/Curved-arrows-tp23312316p23312605.html > > -- Gabor Csardi <[hidden email]> UNIL DGM ______________________________________________ [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. |
In reply to this post by Paul Chatfield-3
?xspline for the shaft, do the head by hand (or using arrows with a very short shaft)
-- 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 Paul Chatfield > Sent: Thursday, April 30, 2009 2:57 AM > To: [hidden email] > Subject: [R] Curved arrows > > > I'm trying to draw an arrow with a curved shaft on the graph as a > straight > one looks messy on a detailed graph. I've looked in arrows but it > doesn't > seem to give an option. larrows doesn't look much more promising. I > had a > look in the archive and couldn't find anything. Any thoughts? > > Thanks > > Paul > -- > View this message in context: http://www.nabble.com/Curved-arrows- > tp23312316p23312316.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. |
Free forum by Nabble | Edit this page |