2

In this MWE the arrow "tip" i. e. the lower little blue line of the arrow is not at the same level as the dashed black line. How can I get it on the same line? Has it to do with baseline?(I looked for other cases e. g. https://tex.stackexchange.com/questions/46853/tikz-large-arrow-tips-at-the-end-of-smooth-curves but did not succeed.)

\documentclass{article}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}
  \draw[|-|, blue] (1,4)--(1,3)node[midway,right]{$h_1$};
  \draw[black, densely dashed] (0.5,3)--(1.2,3);
\end{tikzpicture}
\end{document}

enter image description here

0

1 Answer 1

2

End of arrow head is at given coordinate. In your case this mens. zhan the bottom bar border is at given coordinate. If I understand you correctly, you like to have, that at given coordinate is verical center of bar. This means, that you need to prolong line for 0.5\pgfplineswidth:

\documentclass[border=3.141592]{standalone}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}
  \draw[|-|, 
        shorten >=-0.5\pgflinewidth,  % <--- added 
        blue!50] (1,4)-- node[right]{$h_1$} (1,3) ;
  \draw[densely dashed, very thin] (0.5,3)--(1.2,3);
\end{tikzpicture}
\end{document}

enter image description here

Not the answer you're looking for? Browse other questions tagged .