我在用这个答案绘制时间线。是否可以绘制以下线?
|--------|--------|--------|--------|--------|--------|--------|----->
block # 100 150 200 250 300 350 400 450
|-----------------|---------------||---------|--------|--------|
它将增加N
(大于 1)。
当我尝试\noindent\begin{markschronology}[50]{100}{600}{\textwidth}
该解决方案时,它没有画出正确的线。
我也尝试过这个不画水平线的代码:
\documentclass{article}
\usepackage{chronology}
\begin{document}
\begin{chronology}[50]{100}{600}{3ex}[\textwidth]
\end{chronology}
\end{document}
示例草图:
答案1
\documentclass[tikz, margin=3mm]{standalone}
\usepackage{siunitx}
\usetikzlibrary{positioning,calc, arrows.meta}
\begin{document}
\begin{tikzpicture}
\draw[->, -Latex, line width=1pt] (0,0)node(a){} -- (12,0) node (b) {} ;
\foreach \x [count=\i] in {100,150,...,450,}%
{
\draw[line width=1pt] (\i*1.3,-2mm) node[below](n\i) {\x} -- ++(0,4mm);
}
\draw[->, -Latex, line width=1pt] (0,-1.5cm)node(a){} -- (12,-1.5cm) node (b) {} ;
\draw[line width=1pt] (n1) ++(0,-1.25cm)--++(0,4mm);
\draw[line width=1pt] (n3) ++(0,-1.25cm)--++(0,4mm);
\draw[line width=1pt] (n6) ++(0,-1.25cm)--++(0,4mm);
\draw[line width=1pt] (n7) ++(0,-1.25cm)--++(0,4mm);
\draw[line width=1pt] (n8) ++(0,-1.25cm)--++(0,4mm);
\draw[line width=1pt] (n5) ++(0,-1.25cm)--++(0,4mm);
\draw[line width=1pt] (n5) ++(2pt,-1.25cm)--++(0,4mm);
\end{tikzpicture}
\end{document}
编辑
\documentclass[tikz, margin=3mm]{standalone}
\usepackage{siunitx}
\usetikzlibrary{positioning,calc, arrows.meta}
\begin{document}
\begin{tikzpicture}
\draw[->, -Latex, line width=1pt] (0,0)node(a){} -- (12,0) node (b) {} ;
\foreach \x [count=\i] in {100,150,...,450,}%
{
\draw[line width=1pt] (\i*1.3,-2mm) node[below](n\i) {\x} -- ++(0,4mm);
}
\draw[ line width=1pt, red] (0,-1.5cm)node(a){} -- (12,-1.5cm) node (b) {} ;
\draw[line width=1pt] (n1) ++(0,-1.25cm)--++(0,2mm);
\draw[line width=1pt] (n3) ++(0,-1.25cm)--++(0,4mm);
\draw[line width=1pt] (n6) ++(0,-1.25cm)--++(0,4mm);
\draw[line width=1pt] (n7) ++(0,-1.25cm)--++(0,4mm);
\draw[line width=1pt] (n8) ++(0,-1.25cm)--++(0,4mm);
\draw[line width=1pt] (n5) ++(0,-1.25cm)--++(0,4mm);
\draw[line width=1pt] (n5) ++(2pt,-1.25cm)--++(0,4mm);
\end{tikzpicture}
\end{document}