Advertisement
gonmedare

Untitled

Feb 20th, 2015
346
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.03 KB | None | 0 0
  1. \documentclass[border=3mm,tikz]{standalone}
  2. \usepackage{pgfplots}
  3. \usetikzlibrary{arrows,patterns,backgrounds,fit}
  4.  
  5. \makeatletter
  6. \tikzset{% customization of pattern
  7. % based on <m.wibrow@gm...> - 2013-03-24 07:20:
  8. hatch distance/.store in=\hatchdistance,
  9. hatch distance=5pt,
  10. hatch thickness/.store in=\hatchthickness,
  11. hatch thickness=5pt
  12. }
  13. \pgfdeclarepatternformonly[\hatchdistance,\hatchthickness]{north east hatch}% name
  14. {\pgfqpoint{-1pt}{-1pt}}% below left
  15. {\pgfqpoint{\hatchdistance}{\hatchdistance}}% above right
  16. {\pgfpoint{\hatchdistance-1pt}{\hatchdistance-1pt}}%
  17. {
  18. \pgfsetcolor{\tikz@pattern@color}
  19. \pgfsetlinewidth{\hatchthickness}
  20. \pgfpathmoveto{\pgfqpoint{0pt}{0pt}}
  21. \pgfpathlineto{\pgfqpoint{\hatchdistance}{\hatchdistance}}
  22. \pgfusepath{stroke}
  23. }
  24. \makeatother
  25.  
  26. \tikzset{Pattern/.style={pattern=north east hatch,
  27. pattern color=#1, hatch distance=3mm,
  28. hatch thickness=1pt}}
  29.  
  30. \begin{document}
  31.  
  32. \begin{tikzpicture}[>=triangle 45]
  33. \begin{axis}[
  34. axis lines=middle,
  35. ymax=8,
  36. ymin=-1,
  37. xmax=3.5,
  38. clip=false,
  39. xtick={-4,-3,...,3},
  40. ytick={1,2,...,8},
  41. x tick label style={fill=white}
  42. ]
  43. \addplot[violet, line width=1.75pt, domain=-5.00:3.00] {2^(x)};
  44.  
  45. \node[violet,fill=white]
  46. at (axis cs:3.8,-0.4) {\textbf{\textit{x}}};
  47. \node[right,violet]
  48. at (axis cs:0.2, 8.0)
  49. {{\boldmath$a^{x}$}};
  50. \node[right,violet]
  51. at (axis cs:0.1, 7.3) {{\boldmath$(a \,=\, 2)$}};
  52. \filldraw[red] (axis cs:0,0) circle(2pt);
  53. \draw[violet,line width=0.75pt,dotted]
  54. (axis cs:0.50, 0.00) -- (axis cs:0.50, 1.4142);
  55. \filldraw[violet] (axis cs:0.50, 1.4142) circle(2pt)
  56. node[above,violet]
  57. at (axis cs:0.50, 1.4142)
  58. {\textbf{\textit{a\textsuperscript{x}}}};
  59. \filldraw[blue] (axis cs:0.0,1.0) circle(2pt);
  60.  
  61. \begin{scope}[on background layer]
  62. \node[fit={(axis cs:-5,0) (axis cs:3.5,-1.3)}, inner sep=0pt, Pattern=cyan] {};
  63. \end{scope}
  64. \end{axis}
  65. \end{tikzpicture}
  66.  
  67. \end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement