I have been trying to recreate a similar version of the arrow shown in the image below.
And this is what I manage to get so far:
I am a complete beginner when it comes to TikZ
and after multiple failed attempts, I had to resort to drawing a shaded rectangle and then using right=of rectangle
to append a triangle. However, obviously, the approach is awful. There's also a gap between the "arrowhead" and the line. Initially, I tried using using triangle 90
,triangle 45
and so forth, but I the height of the arrowhead seemed to be dependent on the length of the line (which I did not like), and also I could not figure out how to add text within the line. Here's what I have:
MWE
\documentclass[border=5mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows,positioning,shapes}
\begin{document}
\begin{tikzpicture}[font=\large]
\tikzset{
node distance=0cm,
buffer/.style={
shape border rotate=270,
regular polygon,
regular polygon sides=3,
minimum height=2cm,
fill=blue!50,
}
}
\node (therectangle) at (0,0) [shade,shading=axis,left color=white,right color=blue!50,minimum width=2.5cm,minimum height=1cm,] {Codes for};
\node [buffer,right=of therectangle] {};
\end{tikzpicture}%
\end{document}
What I want is an arrow like shown in the picture, giving me the ability to:
- Add text within.
- Make it shaded.
- Be able to use
below=of <whatever>
etc. - Retain the ability to use
shorten <= <whatever>
etc. - (Optional) Start the shading from the arrowhead.
Could someone help with this?