I have a plot with two horizontal lines. Both lines should have ticks, but only the lower line should have labels below the x-axis.
Unfortunately, I don't know how to add ticks to the upper line, because the units are in cm and the ticks are added in pt. Do I need to convert the 1pt and -3pt to cm and put the absolute values there? I tried to mix using something like this \draw (2.5,15+1pt) -- (2.5,15-3pt) but this failed.
Code:
\begin{figure}
\centering
\begin{tikzpicture}[y=.2cm, x=.7cm]
%axis
\draw (1,0) -- coordinate (x axis mid) (18.9,0);
\draw (1,15) -- coordinate (bla) (18.9,15);
%ticks
\draw (2.5,1pt) -- (2.5,-3pt)
node[anchor=north] {1};
% \draw (2.5,1pt) -- (2.5,-3pt) <---- add here ticks on the upper horizontal line at the same x position as the lower line (1)
\end{tikzpicture}
\captionof{figure}{bla}
\Description{bla}
\label{fig:bla}
\end{figure}


\draw ([yshift=1pt]2.5,15) -- ([yshift=-3pt]2.5,15)– Rmano Mar 09 '21 at 14:41\documentclass.... I have no problem compiling\documentclass[tikz]{standalone} \begin{document} \begin{tikzpicture}[y=.2cm, x=.7cm] \draw (2.5,15+1pt) -- (2.5,15-3pt); \end{tikzpicture} \end{document}– hpekristiansen Mar 09 '21 at 15:48