[Tex/LaTex] How to draw a sketchy surface

tikz-pgf

Maybe the answer is that Tikz is not a good option for this but I was wondering how can I draw a random surface.

I mean the kind of sketch you see during geometry classes to gain intuition about the subject. I don't want it to be precise I just want it to look "handmade"

enter image description here

Best Answer

True random can lead to strange surfaces. It seems you would like to have just a wavy surface. That's easy to do using trigonometric functions. Here's a parametric plot for you with simple cos for a start. You can play with the function, adding further trigonometric functions such as a sin expression to it, or using factors.

\documentclass[border=10pt]{standalone}
\usepackage{pgfplots}
\usepgfplotslibrary{colormaps}
\begin{document}
\begin{tikzpicture}
  \begin{axis}[
    view={120}{40},
    grid=major,
    xmin=-4,xmax=4,
    ymin=-4,ymax=4,
    zmin=-1,zmax=10,
    enlargelimits=upper,
    colormap/bone,
    trig format plots=rad,
  ]
  \addplot3 [ surf, domain=-4:4, domain y=-4:4,
              samples=20, samples y=20,
              variable=\u, variable y=\v,
              point meta=u*v ]
            ( {u}, {v}, {cos(u) + cos(v)} );
  \end{axis}
\end{tikzpicture}
\end{document}

Output