在 Latex 中绘制图像

在 Latex 中绘制图像

我需要帮助创建

在此处输入图片描述

这张图片是 LaTeX 格式的。我尝试使用 TikZ 包来做这件事。但没有得到精确的图像。请帮忙。我非常感谢你能提供的任何帮助。

答案1

在此处输入图片描述

使用库中的括号decorations.pathreplacing

\documentclass[tikz, border=20]{standalone}

\usetikzlibrary{decorations.pathreplacing}

\begin{document}
    \begin{tikzpicture}
        \tikzset{brace/.style = {ultra thick, decorate, decoration={brace,amplitude=10pt,mirror,raise=4pt}}}
        \draw[ultra thick, <->] (0, 0) -- (10, 0);
        \draw[ultra thick] (1, -0.3) -- (1, 0.3);
        \draw[ultra thick] (5, -0.3) -- (5, 0.3);
        \draw[ultra thick] (9, -0.3) -- (9, 0.3);
        \node at (1, -0.5) {\(t_{a^{-m}}\)};
        \node at (5, -0.5) {\(t_{a^{0}}\)};
        \node at (9, -0.5) {\(t_{a^{m}}\)};
        \draw[brace] (5, 0.5) -- (1, 0.5);
        \draw[brace] (9, 0.5) -- (5, 0.5);
        \node at (3, 1.5) {Non-membership (\(LS_2\))};
        \node at (7, 1.5) {Membership (\(LS_1\))};
    \end{tikzpicture}
\end{document}

答案2

使用马查工具(无 MWE 的用户——最小工作示例):

\documentclass[a4paper,12pt]{article}
\usepackage{tikz}
\begin{document}
\tikzset{every picture/.style={line width=0.75pt}} %set default line width to 0.75pt      
\begin{tikzpicture}[x=0.75pt,y=0.75pt,yscale=-1,xscale=1]
\draw    (135,101) -- (472,101) ;
\draw [shift={(474,101)}, rotate = 180] [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.08]  [draw opacity=0] (12,-3) -- (0,0) -- (12,3) -- cycle    ;
\draw [shift={(133,101)}, rotate = 0] [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.08]  [draw opacity=0] (12,-3) -- (0,0) -- (12,3) -- cycle    ;
%Straight Lines [id:da8378236414495226] 
\draw    (180,91) -- (180,110) ;
%Straight Lines [id:da03352235015635352] 
\draw    (300,91) -- (300,110) ;
%Straight Lines [id:da9596557249361286] 
\draw    (421,91) -- (421,110) ;
%Shape: Brace [id:dp20244415173635844] 
\draw   (298.67,89.33) .. controls (298.67,84.66) and (296.34,82.33) .. (291.67,82.33) -- (248.31,82.33) .. controls (241.64,82.33) and (238.31,80) .. (238.31,75.33) .. controls (238.31,80) and (234.98,82.33) .. (228.31,82.33)(231.31,82.33) -- (186.67,82.33) .. controls (182,82.33) and (179.67,84.66) .. (179.67,89.33) ;
%Shape: Brace [id:dp6739360492974413] 
\draw   (419.67,89.33) .. controls (419.67,84.66) and (417.34,82.33) .. (412.67,82.33) -- (369.31,82.33) .. controls (362.64,82.33) and (359.31,80) .. (359.31,75.33) .. controls (359.31,80) and (355.98,82.33) .. (349.31,82.33)(352.31,82.33) -- (307.67,82.33) .. controls (303,82.33) and (300.67,84.66) .. (300.67,89.33) ;
% Text Node
\draw (174,110) node [anchor=north west][inner sep=0.75pt]    {$t_{a^{-m}}$};
% Text Node
\draw (296,110) node [anchor=north west][inner sep=0.75pt]    {$t_{a^{0}}$};
% Text Node
\draw (415,110) node [anchor=north west][inner sep=0.75pt]    {$t_{a^{m}}$};
% Text Node
\draw (150,57) node [anchor=north west][inner sep=0.75pt]   [align=left] {\small Non-membership $(LS_2)$};
% Text Node
\draw (310,57) node [anchor=north west][inner sep=0.75pt]   [align=left] {\small Membership $(LS_1)$};
\end{tikzpicture}

\end{document}

在此处输入图片描述

答案3

为了锻炼,而且因为你是新手...一个更复杂/花哨的解决方案:

\documentclass[border=3.141592]{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,
                decorations.pathreplacing,
                    calligraphy,% had to be loaded after decorations.pathreplacing
                positioning}

\begin{document}
    \begin{tikzpicture}[
            > = Straight Barb,
    BC/.style = {% Brace Calligraphic
        decorate,
        decoration={calligraphic brace, 
                    raise=3pt, amplitude=6pt,
                    pre =moveto, pre  length=1pt,
                    post=moveto, post length=1pt,
                    },
                    very thick, thick, pen colour={black}
                },
every node/.append style = {inner sep=2pt, align=center, anchor=south}
                    ]
\draw[thick,<->] (0,0) -- (8.8,0);
\foreach \i/\j [count=\k] in {1/$t_{a^{-m}}$, 4.5/$t_{a^{0}}$, 8/$t_{a^{m}}$}
    \draw (\i,-2mm)  node[below] {\j} -- ++ (0,4mm) coordinate (n\k);
%
\draw[BC]   (n1) -- node[above=8pt] {Non-membership\\ $(LS_2)$} (n2);
\draw[BC]   (n2) -- node[above=8pt] {Membership\\ $(LS_1)$}     (n3);
    \end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容