# tikz arrow package define where to put the base (starting point) of an arrow

TeX - LaTeX Asked by Herman Jaramillo on December 6, 2020

I am having trouble trying to make tikz to locate the arrow based on the base of the arrow and not on the center. It seems that the center is the default. How can I overwrite that default?

Here is a MWE:

documentclass{article}
usepackage{pgfplots}
usepackage{tikz}
usetikzlibrary[shapes.arrows]
usepgfplotslibrary{fillbetween}

begin{document}

begin{figure}
centering
begin{tikzpicture}[scale=1.7, every node/.style={single arrow, draw=none}]
begin{axis}[ xmin=-1.0,xmax=1.0,
ymin=-0.2,ymax=6.7,
]
plot[name path=A, thick,samples=100,domain=-1:1] {4- sin(180*x)};
plot[name path=B,thick,samples=100,domain=-1:1] {1+x^2};
addplot[fill=gray,opacity=0.4] fill between [of=A and B];
draw[dotted] (-1,0)--(-1,2);
draw[dotted] (1,0)--(1,2);
node [fill=green, single arrow head indent=1ex,minimum height=5cm,
minimum width=2cm,rotate=90] at (-0.5,1.25) {};
node[] at (-0.5,1.25) {Start Here!};

end{axis}
end{tikzpicture}
caption{I need the arrwo to start in the bottom curve}
label{subfig1}
end{figure}

end{document}


Here the picture:

Add anchor=west to the node options. You need the west anchor, not the south, because the node is rotated, and the anchors of the node are rotated along with it.

If your intention is to draw a fat arrow between the two functions though, you're better off using something like

  draw [line width=5mm,
-{Stealth[width=15mm, length=10mm, inset=1mm]},
blue]
(-0.5, {G(-0.5)}) -- (-0.5, {F(-0.5)});


I think, where F and G are functions defined with declare function. (You don't have to do that though, you could write the function expressions directly in the coordinates, replacing x with -0.5.) The Stealth arrow tip is from the arrows.meta library, so that has to be loaded.

documentclass{article}
usepackage{pgfplots} % loads tikz, you don't have to do it explicitly
usetikzlibrary{shapes.arrows, arrows.meta}
usepgfplotslibrary{fillbetween}

begin{document}

begin{figure}
centering
begin{tikzpicture}[
every node/.style={single arrow, draw=none},
declare function={
F(x) = 4- sin(180*x);
G(x) = 1+x*x;
}
]
begin{axis}[
xmin=-1.0,xmax=1.0,
ymin=-0.2,ymax=6.7,
width=10cm,
samples=100,
domain=-1:1
]
addplot[fill=gray,opacity=0.4] fill between [of=A and B];
draw[dotted] (-1,0)--(-1,2);
draw[dotted] (1,0)--(1,2);
node [fill=green, single arrow head indent=1ex,minimum height=5cm,
minimum width=2cm,rotate=90, anchor=west] at (-0.5,1.25) {};

draw [line width=5mm,
-{Stealth[width=15mm, length=10mm, inset=1mm]},
blue]
(-0.5, {G(-0.5)}) -- (-0.5, {F(-0.5)});

end{axis}
end{tikzpicture}
caption{I need the arrwo to start in the bottom curve}
label{subfig1}
end{figure}

end{document}


Answered by Torbjørn T. on December 6, 2020

## Related Questions

### How to implement savebox

2  Asked on May 14, 2021 by user239498

### Creating tables with spanning rows/columns

2  Asked on May 14, 2021 by nishant

### How to display x-coordinates near data points in pgf plot?

1  Asked on May 14, 2021 by gouldbach

### How can I set footnote size to 10 and how to do basic line spacing?

1  Asked on May 14, 2021 by w12345678

### Glossaries Package Entry wont disappear

0  Asked on May 14, 2021 by kataran

### Chapter-specific appendices with numbers related to the chapters

1  Asked on May 14, 2021 by gwg

### Don’t show initials in short version of author with same last name in biblatex windy city style

1  Asked on May 14, 2021

### Drawing a convolution with Tikz

5  Asked on May 14, 2021

### side by side image that doesn’t affect IEEE class? table font and bib indexing got messed up

0  Asked on May 14, 2021 by ordem

### macro only for tikz

1  Asked on May 14, 2021

### expl3 – keyval_parse:NNn – why only functions which absorb exactly 1 respective 2 arguments?

2  Asked on May 14, 2021

### How can I move arrows towards left or right in a tikz figure?

1  Asked on May 13, 2021

### Error: LaTeX Error: Something’s wrong–perhaps a missing item

5  Asked on May 13, 2021 by user6875880

### Set Hospital name and subsitute

1  Asked on May 13, 2021 by chris-peh

### How to obtain a minitoc with classicthesis?

1  Asked on May 13, 2021

### Automagically scale Tikz-Picture and use Externalization and setting of file name

0  Asked on May 13, 2021 by tillleiden

### Dimension too large in includegraphics

0  Asked on May 13, 2021 by bean-guy

### Automatic dotted lines

1  Asked on May 13, 2021 by junpyo-choi

### Extra space in index entry

2  Asked on May 13, 2021 by tommiie

### How can I process each element of SplitArgument succinctly?

2  Asked on May 13, 2021 by grayscale