Message Boards Message Boards

0
|
12052 Views
|
12 Replies
|
5 Total Likes
View groups...
Share
Share this post:

Add arrows in Graphics?

Posted 8 years ago

I know it is possible to add an arrow if two points are stated.

This is annoying for curves like parabolas etc. Is there and easier way than calculating 2 points to make an arrow?

POSTED BY: Peter Munro
12 Replies

Something that might get you started is:

Plot[Sin[x], {x, 0, 2Pi}] /. Line->Arrow

enter image description here

POSTED BY: Carl Woll

How do I put an arrow on the left end only? How do I put an arrow on both ends?

After all the examples shown to you above, is it really that hard to read documentation on Arrow and see examples there on exactly what you are asking? You have a complete control with option Arrowheads, which you could have found out if you would only make an effort to read the docs:

Plot[Sin[x], {x, 0, 2 Pi}] /.Line[x_] -> {Arrowheads[{-.1, .05}], Arrow[x]}

Set size parameter 0 to "remove" Arrowheads. Please invest effort in learning doc examples in future. Read the forum rules:

http://wolfr.am/READ-1ST

POSTED BY: Sam Carrettie
Posted 8 years ago

I can see this exact information character for character from the link I provided.

The question is "How to put an arrow on the end of any relation?"

Can this put an arrow on one end or both ens of a polynomial, or sine function etc?

POSTED BY: Peter Munro

Hi Peter, it is not very clear what you want to achieve, do you have some code or sketch?

POSTED BY: Sander Huisman
Posted 8 years ago

To add an arrow to y=x is easy using Arrow[{pt1,pt2}], and the max and min of the domain.

Adding an arrow to y=x^2 is annoying because the points {pt1, pt2} that will create an arrow in the proper direction is difficult because the slope of the line changes.

It is easy to add an arrow to a stock curve like a bspline curve. Is it possible to automatically add an arrow to any curve? If so how?

for arrow function details see

http://reference.wolfram.com/language/ref/Arrow.html

POSTED BY: Peter Munro

You may have a look at the free package CurvesGraphics6

POSTED BY: Gianluca Gorni

You can wrap Arrow around several line specifications:

Arrow[Line[...]]
Arrow[BezierCurve[...]]
Arrow[BSplineCurve[...]]
Arrow[JoinedCurve[...]]

and in 3D also:

Arrow[Tube[...]]
POSTED BY: Sander Huisman
Posted 8 years ago

I have seen this package put arrows in the middle. Can it put arrows only at one end or the other or both for any relation?

POSTED BY: Peter Munro

You asked:

It is easy to add an arrow to a stock curve like a bspline curve.

So the answer:

Arrow[BSplineCurve[...]]

is exactly what you want...

POSTED BY: Sander Huisman
Graphics[Cases[Plot[Sin[x],{x,0,2Pi}],Line[x_]:>Arrow[Line[x]],\[Infinity]]]
Graphics[Cases[ParametricPlot[{Sin[u],Sin[2u]},{u,0,2Pi}],Line[x_]:>Arrow[Line[x]],\[Infinity]]]
Graphics[Cases[Plot[0.3x^2-1x,{x,-3,3}],Line[x_]:>Arrow[Line[x]],\[Infinity]]]
Graphics[Cases[Plot[{Sin[x],Sin[2x]},{x,0,2Pi}],Line[x_]:>Arrow[Line[x]],\[Infinity]]]

This will work for plot functions that do not produce GraphicsComplex objects: ParametricPlot with parametric curves, Plot, PolarPlot, et cetera...

POSTED BY: Sander Huisman
Posted 8 years ago

This is what I am after.

How do I put an arrow on the left end only?

How do I put an arrow on both ends?

POSTED BY: Peter Munro
Posted 8 years ago

These are examples. I used Snagit to capture the screen. I will use this arrow code in the free solution videos at eTutoring.com

Attachments:
POSTED BY: Peter Munro
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract