使用 TikZ 制作坐标系

使用 TikZ 制作坐标系

预期结果

我在使用软件包制作这些信号时遇到了问题TikZ。有人能解释一下TikZ软件包、它的工作原理以及我该如何开始制作它吗?

答案1

如果您只想绘制这些坐标系和信号,这里有一个示例可以说明如何操作:

\documentclass[tikz, border=2mm]{standalone}
\usetikzlibrary{arrows.meta}
\usetikzlibrary{decorations.pathreplacing}  % curly brace

\begin{document}
    \begin{tikzpicture}[
        thick,
        arrow/.style={
            -Latex
        }
    ]

        %%%%%%%%%%%%%%%%
        % First Graphic
        %%%%%%%%%%%%%%%%

        % coordinate system
        \draw[arrow] (-1.25,0) -- node[at end, below] {$\phi_1(t)$} (5,0);
        \draw[arrow] (0,-1.25) -- node[at end, left] {$\phi_2(t)$} (0,5);

        % red and blue arrow
        \draw[arrow, draw=red]  (0,0) -- node[midway, above] {$s_1$} (4,0);
        \draw[arrow, draw=blue] (0,0) -- node[midway, right] {$s_2$} (0,4);

        % dashed line
        \draw[dashed] (4,0) -- node[midway, above right] {$\sqrt{2 E_b}$} (0,4);

        % curly braces
        \draw [decorate, decoration={brace, mirror, amplitude=6pt}] (.15,-.25) -- node[midway, below=.25cm] {$\sqrt{E_b}$} (3.85,-.25);
        \draw [decorate, decoration={brace, amplitude=6pt}] (-.25,.15) -- node[midway, left=.25cm] {$\sqrt{E_b}$} (-.25,3.85);
            
        %%%%%%%%%%%%%%%%
        % Second Graphic
        %%%%%%%%%%%%%%%%

        \begin{scope}[xshift=11.5cm]
            % coordinate system
            \draw[arrow] (-5,0) -- node[at end, below] {$\phi_1(t)$} (5,0);
            \draw[arrow] (0,-1.25) -- node[at end, left] {$\phi_2(t)$} (0,2);

            % red and blue arrow
            \draw[arrow, draw=red]  (0,0) -- node[midway, above] {$s_1$} (4,0);
            \draw[arrow, draw=blue] (0,0) -- node[midway, above] {$s_2$} (-4,0);

            % curly braces
            \draw [decorate, decoration={brace, mirror, amplitude=6pt}] (.15,-.25) -- node[midway, below=.25cm] {$\sqrt{E_b}$} (3.85,-.25);
            \draw [decorate, decoration={brace, amplitude=6pt}] (-.15,-.25) -- node[midway, below=.25cm] {$\sqrt{E_b}$} (-3.85,-.25);
        \end{scope}
    \end{tikzpicture}
\end{document}

结果

相关内容