Skip to content

[BUG]: cannot render the geek alphabet correctly. #96

@ChenXu-Huang

Description

@ChenXu-Huang
\usepackage{tikz}
\usepackage{amsmath}
\begin{document}
\begin{tikzpicture}[scale=1.2, domain=-2.2:2.2, samples=100]
    \draw[->, thick] (-3.2,0) -- (3.5,0) node[right] {$z$};
    \draw[->, thick] (0,-0.5) -- (0,5.5) node[above] {$l(z)$};
    \node[below left] at (0,0) {O};

    \draw[gray!20, thin] (-3,0) grid (3,5);
    
    \pgfmathsetmacro{\epsilon}{1}
    
    \draw[blue, thick] plot (\x, {
        ifthenelse(abs(\x)<=\epsilon, 0, abs(\x)-\epsilon)
    }) node[right] {$l_\epsilon(z)$};
    
    \draw[red, thick, dashed] plot (\x, {\x*\x}) 
        node[above right] {$l(z)=z^2$};
    
    \draw[dashed] (-\epsilon,0) -- (-\epsilon,5) node[pos=0.2, left] {$z=-\epsilon$};
    \draw[dashed] (\epsilon,0) -- (\epsilon,5) node[pos=0.2, right] {$z=\epsilon$};
    \fill[blue] (-\epsilon,0) circle (2pt) (\epsilon,0) circle (2pt);
    
    \node[draw, fill=white, rounded corners, anchor=north west] at (-3,5) {
        \begin{tabular}{l @{\ } l}
            \textcolor{blue}{line} & $l_\epsilon(z)$ \\
            \textcolor{red}{dashed} & $l(z)$ \\
            \textcolor{black}{dashed} & $\epsilon$ ($\epsilon=1$)
        \end{tabular}
    };
\end{tikzpicture}
\end{document}

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions