关于 Tikz 中线段下支撑的问题

关于 Tikz 中线段下支撑的问题

我想画一些类似的东西。我不知道如何对下限和上限进行支撑,因为它通常用在方程式下,我不知道如何在 tikz 环境下应用它。希望得到一些帮助。在此处输入图片描述

答案1

一个简单的方法是借助decorations.pathreplacing库。像这样:

\documentclass[border=2mm]{standalone}
\usepackage    {tikz}
\usetikzlibrary{decorations.pathreplacing}

\tikzset%
{% these sytles provide the underbrace and the text below
  myunderbrace/.style={decorate,decoration={brace,raise=4mm,amplitude=2pt,mirror}},
  mytext/.style={below,midway,yshift=-4mm}
}

\begin{document}
\begin{tikzpicture}[line cap=round]
  \draw (0,0) -- (9,0);
  \draw[myunderbrace]   (0,0) -- (3,0) node[mytext] {\strut lower bounds};
  \draw[myunderbrace]   (6,0) -- (9,0) node[mytext] {\strut upper bounds};
  \draw[line width=1mm] (3,0) -- (3.7,0);
  \draw[line width=1mm] (4,0) -- (5,0);
  \foreach\i in {5.3,5.6,5.8,5.9,5.95,6}
  \fill (\i,0) circle (0.5mm);
  \node (inf) at (3,1)    {$\inf A$};
  \node (sup) at (6,1)    {$\sup A$};
  \node (A)   at (4.5,-1) {$A$};
  \draw[-latex] (inf) --++ (0,-0.75);
  \draw[-latex] (sup) --++ (0,-0.75);
  \draw[-latex] (A)   --++ (0,0.75);
  \draw[-latex] (A)   --++ (-0.75,0.75);
  \draw[-latex] (A)   --++ (0.75,0.75);
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容