Page 1 of 1

\documentclass{standalone}
\standaloneconfig{margin=2mm}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\usetikzlibrary{patterns}

% Custom -45 degree dashed pattern definition
\pgfdeclarepatternformonly{diagonal dashes}{\pgfpoint{0pt}{0pt}}{\pgfpoint{20pt}{20pt}}{\pgfpoint{20pt}{20pt}}%
{
    \pgfsetlinewidth{0.5pt}
    \foreach \i in {-20, -10, ..., 20} {
        \pgfpathmoveto{\pgfpoint{0pt}{\i pt}}
        \pgfpathlineto{\pgfpoint{20pt}{20pt+\i pt}}
    }
    \pgfusepath{stroke}
}

\begin{document}

\begin{tikzpicture}[scale=1.00]
    \begin{axis}[axis lines=center,
        xlabel={$x$},
        ylabel={$y$},
        ytick={-1,0.5,1,1.5,2,3},
        xtick={-1.5,1,2.2,3},
        xmin=-4.5,xmax=5,
        ymin=-2,ymax=2,
        unbounded coords=jump,
        samples=200,
        xticklabel style={font=\tiny},
        yticklabel style={font=\tiny},
    ]
    \coordinate (A) at (-2,-1);
    \coordinate (B) at (0,-1);
    \coordinate (C) at (2,1);
    \coordinate (D) at (0,1);

    % Fill the polygon with a custom -45 degree dashed pattern
    \fill[pattern=diagonal dashes, pattern color=black!20] (A) -- (B) -- (C) -- (D) -- cycle;
    % Draw the outline of the polygon
    \draw (A) -- (B) -- (C) -- (D) -- cycle;

    \draw (0,0) circle (0.1cm);
    \node[right] at (B) {$v=u-1$};
    \node[right,rotate=45] at (D) {$v=u+1$};

    \end{axis}
\end{tikzpicture}

\end{document}

Leave a comment if you like this content أترك تعليقا إن أعجبك المحتوى

Class: Figures
Views:  109




0 Comments, Latest

No comments yet. Be the first to Comment

Most viewed courses: