How to draw a graph that looks wonky(like hand drawn)
How to draw a graph that looks wonky(like hand drawn)
How would you draw a graph in latex that looks like below?
Something that looks almost hand drawn but still Latex generated.
Please note that I do not care about axes labels in this question.
I have included the graph template code below, where I want to draw such graph.
documentclassarticle
usepackage[margin=0.5in]geometry
usepackagepgfplots
renewcommandthesectionarabicsection
usepackagemathtools
usepackagecancel
usepackagepgfplots
usepackageamsmath
newtheoremtheoremTHEOREM
newtheoremproofPROOF
usepackagetikz
usepackageamssymb
usetikzlibrarypatterns
usepgfplotslibraryfillbetween
newenvironmenttightcenter
setlengthtopsep0pt
setlengthparskip0pt
begincenterendcenter
begindocument
% !TeX spellcheck = en_GB
begintikzpicture
beginaxis[
axis lines=middle,
grid=major,
%ticks=none,
xmin=-0.4,
xmax=6.5,
ymin=-1,
ymax=11,
xtick=0,1,2,3,4,5,6,
ytick=0,2.5,5,7.5,10,
height=9cm,
width=12cm,
axis line style=shorten >=-10pt, shorten <=-10pt,
ylabel style=
anchor=south,
at=(ticklabel* cs:1.0),
yshift=10pt
,
ylabel=y,
xlabel style=
anchor=west,
at=(ticklabel* cs:1.0),
xshift=10pt
,
xlabel=x,
axis line style=shorten >=-10pt, shorten <=-10pt,
yticklabel style=
fill=white,
%yshift=10pt,
,
xticklabel style=
%xshift=10pt,
fill=white
]
endaxis
endtikzpicture
enddocument
Thank you
Take a look at these questions with excellent answers: (1) tex.stackexchange.com/questions/74878/… (2) tex.stackexchange.com/questions/95322/…
– Tom
Aug 24 at 8:27
1 Answer
1
Here is a proposal: build up list and plot it smoothly. Of course, you can adjust the step (it is 0.5 in the example below) and the amplitude (1.5 in the example below).
documentclassarticle
usepackage[margin=0.5in]geometry
usepackagepgfplots
renewcommandthesectionarabicsection
usepackagemathtools
usepackagecancel
usepackagepgfplots
usepackageamsmath
newtheoremtheoremTHEOREM
newtheoremproofPROOF
usepackagetikz
usepackageamssymb
usetikzlibrarypatterns
usepgfplotslibraryfillbetween
newenvironmenttightcenter
setlengthtopsep0pt
setlengthparskip0pt
begincenterendcenter
begindocument
% !TeX spellcheck = en_GB
foreach X [count=Y] in 0,0.5,...,6
ifnumY=1
pgfmathsetmacromyrnd10*rnd
xdefmyrndmyrnd
xdefLst(X,myrnd)
else
pgfmathsetmacromyrndmyrnd+1.5*(rnd-0.5)
xdefmyrndmyrnd
xdefLstLst (X,myrnd)
fi
typeoutLst
begintikzpicture
beginaxis[
axis lines=middle,
grid=major,
%ticks=none,
xmin=-0.4,
xmax=6.5,
ymin=-1,
ymax=11,
xtick=0,1,2,3,4,5,6,
ytick=0,2.5,5,7.5,10,
height=9cm,
width=12cm,
axis line style=shorten >=-10pt, shorten <=-10pt,
ylabel style=
anchor=south,
at=(ticklabel* cs:1.0),
yshift=10pt
,
ylabel=y,
xlabel style=
anchor=west,
at=(ticklabel* cs:1.0),
xshift=10pt
,
xlabel=x,
axis line style=shorten >=-10pt, shorten <=-10pt,
yticklabel style=
fill=white,
%yshift=10pt,
,
xticklabel style=
%xshift=10pt,
fill=white
]
addplot[smooth] coordinates Lst;
endaxis
endtikzpicture
enddocument
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Maybe this question is of interest?
– Max
Aug 24 at 2:11