Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- \documentclass[border=3mm,tikz]{standalone}
- \usepackage{pgfplots}
- \usetikzlibrary{arrows,patterns,backgrounds,fit}
- \makeatletter
- \tikzset{% customization of pattern
- % based on <m.wibrow@gm...> - 2013-03-24 07:20:
- hatch distance/.store in=\hatchdistance,
- hatch distance=5pt,
- hatch thickness/.store in=\hatchthickness,
- hatch thickness=5pt
- }
- \pgfdeclarepatternformonly[\hatchdistance,\hatchthickness]{north east hatch}% name
- {\pgfqpoint{-1pt}{-1pt}}% below left
- {\pgfqpoint{\hatchdistance}{\hatchdistance}}% above right
- {\pgfpoint{\hatchdistance-1pt}{\hatchdistance-1pt}}%
- {
- \pgfsetcolor{\tikz@pattern@color}
- \pgfsetlinewidth{\hatchthickness}
- \pgfpathmoveto{\pgfqpoint{0pt}{0pt}}
- \pgfpathlineto{\pgfqpoint{\hatchdistance}{\hatchdistance}}
- \pgfusepath{stroke}
- }
- \makeatother
- \tikzset{Pattern/.style={pattern=north east hatch,
- pattern color=#1, hatch distance=3mm,
- hatch thickness=1pt}}
- \begin{document}
- \begin{tikzpicture}[>=triangle 45]
- \begin{axis}[
- axis lines=middle,
- ymax=8,
- ymin=-1,
- xmax=3.5,
- clip=false,
- xtick={-4,-3,...,3},
- ytick={1,2,...,8},
- x tick label style={fill=white}
- ]
- \addplot[violet, line width=1.75pt, domain=-5.00:3.00] {2^(x)};
- \node[violet,fill=white]
- at (axis cs:3.8,-0.4) {\textbf{\textit{x}}};
- \node[right,violet]
- at (axis cs:0.2, 8.0)
- {{\boldmath$a^{x}$}};
- \node[right,violet]
- at (axis cs:0.1, 7.3) {{\boldmath$(a \,=\, 2)$}};
- \filldraw[red] (axis cs:0,0) circle(2pt);
- \draw[violet,line width=0.75pt,dotted]
- (axis cs:0.50, 0.00) -- (axis cs:0.50, 1.4142);
- \filldraw[violet] (axis cs:0.50, 1.4142) circle(2pt)
- node[above,violet]
- at (axis cs:0.50, 1.4142)
- {\textbf{\textit{a\textsuperscript{x}}}};
- \filldraw[blue] (axis cs:0.0,1.0) circle(2pt);
- \begin{scope}[on background layer]
- \node[fit={(axis cs:-5,0) (axis cs:3.5,-1.3)}, inner sep=0pt, Pattern=cyan] {};
- \end{scope}
- \end{axis}
- \end{tikzpicture}
- \end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement