Advertisement
kalakay

PGF3D

Mar 14th, 2015
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Latex 4.82 KB | None | 0 0
  1. \documentclass[a4paper,10pt]{article}
  2. %http://tex.stackexchange.com/questions/34302/surface-of-revolution/34303#34303
  3. \usepackage[hmargin=1.5cm,top=1.5cm]{geometry}
  4. \usepackage[svgnames,dvipsnames]{xcolor}
  5. \usepackage[labelformat=simple]{caption}
  6. \usepackage[T1]{fontenc}
  7. \usepackage[indonesian]{babel}
  8. \usepackage{gentium,fourier}
  9. \usepackage{adjustbox}
  10. \usepackage{url}
  11. \usepackage{amsmath,bm}
  12. \let\ds\displaystyle
  13. \usepackage{tikz,pgfplots}
  14. \pgfplotsset{compat=1.10}
  15. \usepgfplotslibrary{fillbetween}
  16. \usepgfplotslibrary{colormaps}
  17. %\usepgfplotslibrary{patchplots}
  18.  
  19. \definecolor{stempel}{RGB}{0 34 85}  
  20.  
  21. \begin{document}
  22.  
  23. \adjustbox{valign=t}{\begin{minipage}[t]{0.4\textwidth}
  24. \centering
  25. \begin{tikzpicture}[transform shape,scale=1]
  26. \node {%
  27. \begin{tikzpicture}[]
  28. \pgfplotsset{set layers}
  29. \begin{axis}[
  30.    axis lines=middle,
  31.    xtick={-2,-1,2,3},              
  32.     ytick=\empty,               % gambar 1
  33.     xlabel={\large $x$},
  34.    ylabel={\large $y$},
  35.     xmin=-3, xmax=4,
  36.     ymin=-8.5,ymax=6,
  37.     samples=500,enlargelimits=false]
  38. \addplot[name path=A,domain=-2.15:3.15,Navy,smooth] {x^3-x^2-6*x} node[above left] {$y=x^3-x^2-6x$};
  39. \path[name path=B] (axis cs:-1,0)--(axis cs:2,0);
  40. \addplot[draw,fill=DarkOrange!50!Yellow,opacity=.75] fill between[of=A and B,soft clip={domain=-1:2}];
  41. \end{axis}
  42. \end{tikzpicture}%
  43. };%
  44. \end{tikzpicture}%
  45. \captionof{figure}{}
  46. \end{minipage}}\hfill
  47. %
  48. \adjustbox{valign=t}{\begin{minipage}[t]{0.45\textwidth}
  49. \centering
  50. \begin{tikzpicture}
  51. \begin{axis}[]
  52.   \addplot3[surf,shader=flat,       % gambar 2
  53.   samples=20,
  54.   domain=-1:2,y domain=0:2*pi,
  55.   z buffer=sort]
  56.   (x,{(x^3-x^2-6*x)*cos(deg(y))}, {(x^3-x^2-6*x)*sin(deg(y))});
  57. \end{axis}
  58. \end{tikzpicture}
  59. \captionof{figure}{}
  60. \end{minipage}}\hfill
  61.  
  62. \bigskip
  63. \adjustbox{valign=t}{\begin{minipage}[t]{0.45\textwidth}
  64. \centering
  65. \begin{tikzpicture}
  66.    \begin{axis}[view={15}{7},
  67. xlabel=$x$, ylabel=$y$, zlabel=$z$,
  68. after end axis/.code={
  69.    \draw [-stealth, thick, red] (xticklabel cs:0.2) -- (xticklabel cs:0.8);
  70.    \draw [-stealth, thick, red] (yticklabel cs:0.2) -- (yticklabel cs:0.8);
  71.    \draw [-stealth, thick, red] (zticklabel cs:0.2) -- (zticklabel cs:0.8);                
  72.                    }               % gambar 3
  73.                 ]
  74. \addplot3[surf,shader=flat,
  75.  samples=20,colormap/cool,
  76.  domain=-1:2,y domain=0:2*pi,
  77.  z buffer=sort]
  78.   (x,{(x^3-x^2-6*x)*cos(deg(y))}, {(x^3-x^2-6*x)*sin(deg(y))});
  79.    \end{axis}
  80. \end{tikzpicture}
  81. \captionof{figure}{}
  82. \end{minipage}}\hfill
  83. %
  84. \adjustbox{valign=t}{\begin{minipage}[t]{0.45\textwidth}
  85. \centering
  86. \begin{tikzpicture}
  87. \begin{axis}[view={15}{5}]
  88.   \addplot3[mesh,shader=faceted,
  89.  samples=20,colormap/jet,
  90.  domain=-1:2,y domain=0:2*pi,
  91.  z buffer=sort]                        % gambar 4
  92.   (x,{(x^3-x^2-6*x)*cos(deg(y))}, {(x^3-x^2-6*x)*sin(deg(y))});
  93. \end{axis}
  94. \end{tikzpicture}
  95. \captionof{figure}{}
  96. \end{minipage}}\hfill
  97.  
  98. \bigskip
  99. \adjustbox{valign=t}{\begin{minipage}[t]{0.45\textwidth}
  100. \centering
  101. \begin{tikzpicture}
  102. \begin{axis}[view={15}{5}]
  103.   \addplot3[surf,shader=faceted interp,
  104.   samples=20,colormap/winter,
  105.   domain=-1:2,y domain=0:2*pi,              % gambar 5
  106.   z buffer=sort]
  107.   (x,{(x^3-x^2-6*x)*cos(deg(y))}, {(x^3-x^2-6*x)*sin(deg(y))});
  108. \end{axis}
  109. \end{tikzpicture}
  110. \captionof{figure}{}
  111. \end{minipage}}\hfill
  112. %
  113. \adjustbox{valign=t}{\begin{minipage}[t]{0.45\textwidth}
  114. \centering
  115. \begin{tikzpicture}
  116. \begin{axis}[grid=both,view = {20}{10}]
  117.   \addplot3[surf,shader=faceted interp,
  118.   colormap/greenyellow,
  119.   samples=50,
  120.   domain=-1:2,y domain=0:2*pi,              % gambar 6
  121.   z buffer=sort]
  122.   (x,{(x^3-x^2-6*x)*cos(deg(y))}, {(x^3-x^2-6*x)*sin(deg(y))});
  123. \end{axis}
  124. \end{tikzpicture}
  125. \captionof{figure}{}
  126. \end{minipage}}\hfill
  127.  
  128. \newpage
  129. \adjustbox{valign=t}{\begin{minipage}[t]{0.45\textwidth}
  130. \centering
  131. \begin{tikzpicture}
  132. \begin{axis}[view = {20}{10}]
  133.   \addplot3[surf,shader=interp,
  134.   colormap/blackwhite,
  135.   samples=50,
  136.   domain=-1:2,y domain=0:2*pi,              % gambar 7
  137.   z buffer=sort]
  138.   (x,{(x^3-x^2-6*x)*cos(deg(y))}, {(x^3-x^2-6*x)*sin(deg(y))});
  139. \end{axis}
  140. \end{tikzpicture}
  141. \captionof{figure}{}
  142. \end{minipage}}\hfill
  143. %
  144. \adjustbox{valign=t}{\begin{minipage}[t]{0.45\textwidth}
  145. \centering
  146. \begin{tikzpicture}
  147. \begin{axis}[view = {20}{10},
  148.            axis lines=middle, axis on top,
  149.            xtick={-1,0,1,2},ytick=\empty,ztick=\empty,
  150.            enlargelimits=true]
  151.  \addplot3[surf,shader=interp,
  152.  colormap={pos}{color(0cm)=(DarkSlateBlue);
  153.  color(1cm)=(DarkSlateBlue!30);
  154.  color(2cm)=(DarkSlateBlue)},
  155.   samples=30,
  156.   domain=-1:2,y domain=0:2*pi,              % gambar 8
  157.   z buffer=sort]
  158.   (x,{(x^3-x^2-6*x)*cos(deg(y))}, {(x^3-x^2-6*x)*sin(deg(y))});
  159. \end{axis}
  160. \end{tikzpicture}
  161. \captionof{figure}{}
  162. \end{minipage}}\hfill
  163.  
  164. \end{document}%-----------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement