如何在时间线下方绘制水平花括号?

如何在时间线下方绘制水平花括号?

我使用以下答案绘制了时间表如何连续绘制多个时间轴. 是否可以在时间线下方与其标签一起添加水平花括号?

期望草图如下:

在此处输入图片描述


时间线示例的代码:

\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){} -- (11,0) node (b) {} ;
  \foreach \x [count=\i] in {0,50,...,500}
  {
    \def \inBetSpace {1}
    \draw[line width=1pt] (\i*\inBetSpace-\inBetSpace,-2mm) node[below](n\i) {\x} -- ++(0,4mm);
  }
\end{tikzpicture}
\end{document}

答案1

在此处输入图片描述

\documentclass[tikz, margin=3mm]{standalone}
\usepackage{siunitx}
\usetikzlibrary{positioning,calc, arrows.meta}
\usetikzlibrary{decorations.pathreplacing}

\begin{document}
\begin{tikzpicture}
  \draw[->, -Latex, line width=1pt] (0,0)node(a){} -- (11,0) node (b) {} ;
  \foreach \x [count=\i] in {0,50,...,500}
  {
    \def \inBetSpace {1}
    \draw[line width=1pt] (\i*\inBetSpace-\inBetSpace,-2mm) node[below](n\i) {\x} -- ++(0,4mm);
  }
\draw[decorate, decoration={brace, amplitude=6pt},] ([yshift=-1cm]2.95,0)-- node[below=0.25cm]
{Label-1}([yshift=-1cm]a.center);
\draw[decorate, decoration={brace, amplitude=6pt},] ([yshift=-1cm]9,0)-- node[below=0.25cm]
{Label-2}([yshift=-1cm]3.05,0);
\end{tikzpicture}
\end{document}

使用字体大小\tiny\scriptsize字体进行编辑\texttt

\documentclass[tikz, margin=3mm]{standalone}
\usepackage{siunitx}
\usetikzlibrary{positioning,calc, arrows.meta}
\usetikzlibrary{decorations.pathreplacing}

\begin{document}
\begin{tikzpicture}
  \draw[->, -Latex, line width=1pt] (0,0)node(a){} -- (11,0) node (b) {} ;
  \foreach \x [count=\i] in {0,50,...,500}
  {
    \def \inBetSpace {1}
    \draw[line width=1pt] (\i*\inBetSpace-\inBetSpace,-2mm) node[below](n\i) {\x} -- ++(0,4mm);
  }
\draw[decorate, decoration={brace, amplitude=6pt},] ([yshift=-1cm]2.95,0)-- node[below=0.25cm]
{\texttt{\tiny Label-1}}([yshift=-1cm]a.center);
\draw[decorate, decoration={brace, amplitude=6pt},] ([yshift=-1cm]9,0)-- node[below=0.25cm]
{\scriptsize Label-2}([yshift=-1cm]3.05,0);
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容