I want to create a picture with 3 (or more) plots, which will have a their standard deviation over hundreds of samples. This is my Latex picture:
It doesn't look very nice because of the high amount of samples. Here's the same picture in MatLab:
It's somewhat stretched (because of my monitor, don't worry about it), but the shaded error looks so much better. How can I do this in Latex?
I have the latex code sample for just 1 plot here:
\begin{figure*}[!t]
\centering
\begin{tikzpicture}
\begin{axis}[
xmin=0, xmax=104,
ymin=0, ymax=500,
ymajorgrids=true,
grid style=dashed,
width=0.9\textwidth,
]
\addplot[color=red, error bars/.cd, y dir=both, y explicit] coordinates {(0,0.224)+=(0,0.000)-=(0,0.000)(1,4.205)+=(1,3.416)-=(1,3.416)(2,25.467)+=(2,14.280)-=(2,14.280)(3,52.231)+=(3,20.196)-=(3,20.196)(4,65.673)+=(4,20.982)-=(4,20.982)(5,69.218)+=(5,14.747)-=(5,14.747)(6,71.268)+=(6,14.081)-=(6,14.081)(7,73.148)+=(7,16.250)-=(7,16.250)(8,73.693)+=(8,18.405)-=(8,18.405)(9,73.599)+=(9,22.527)-=(9,22.527)(10,77.449)+=(10,27.273)-=(10,27.273)(11,89.192)+=(11,42.360)-=(11,42.360)(12,96.434)+=(12,47.407)-=(12,47.407)(13,95.075)+=(13,48.195)-=(13,48.195)(14,91.326)+=(14,47.163)-=(14,47.163)(15,89.722)+=(15,45.783)-=(15,45.783)(16,88.292)+=(16,47.313)-=(16,47.313)(17,88.676)+=(17,46.570)-=(17,46.570)(18,92.385)+=(18,48.606)-=(18,48.606)(19,100.665)+=(19,58.200)-=(19,58.200)(20,101.036)+=(20,59.284)-=(20,59.284)(21,99.163)+=(21,56.802)-=(21,56.802)(22,98.548)+=(22,56.120)-=(22,56.120)(23,96.174)+=(23,56.345)-=(23,56.345)(24,95.205)+=(24,56.569)-=(24,56.569)(25,96.056)+=(25,55.202)-=(25,55.202)(26,100.164)+=(26,53.525)-=(26,53.525)(27,101.274)+=(27,55.441)-=(27,55.441)(28,103.403)+=(28,56.793)-=(28,56.793)(29,105.818)+=(29,59.267)-=(29,59.267)(30,106.274)+=(30,57.561)-=(30,57.561)(31,108.765)+=(31,55.798)-=(31,55.798)(32,114.637)+=(32,50.816)-=(32,50.816)(33,118.263)+=(33,48.703)-=(33,48.703)(34,118.484)+=(34,49.160)-=(34,49.160)(35,117.704)+=(35,48.206)-=(35,48.206)(36,119.837)+=(36,47.593)-=(36,47.593)(37,118.594)+=(37,48.779)-=(37,48.779)(38,116.587)+=(38,50.543)-=(38,50.543)(39,117.633)+=(39,56.970)-=(39,56.970)(40,123.923)+=(40,58.094)-=(40,58.094)(41,126.986)+=(41,62.988)-=(41,62.988)(42,126.599)+=(42,54.805)-=(42,54.805)(43,128.723)+=(43,57.758)-=(43,57.758)(44,131.958)+=(44,56.155)-=(44,56.155)(45,136.809)+=(45,60.811)-=(45,60.811)(46,135.276)+=(46,64.177)-=(46,64.177)(47,135.190)+=(47,64.530)-=(47,64.530)(48,136.841)+=(48,63.921)-=(48,63.921)(49,135.721)+=(49,61.899)-=(49,61.899)(50,139.175)+=(50,64.210)-=(50,64.210)(51,141.411)+=(51,59.908)-=(51,59.908)(52,141.724)+=(52,60.329)-=(52,60.329)(53,143.269)+=(53,59.867)-=(53,59.867)(54,148.070)+=(54,58.350)-=(54,58.350)(55,143.483)+=(55,57.578)-=(55,57.578)(56,144.473)+=(56,59.385)-=(56,59.385)(57,148.930)+=(57,62.112)-=(57,62.112)(58,155.431)+=(58,62.463)-=(58,62.463)(59,160.489)+=(59,63.534)-=(59,63.534)(60,159.029)+=(60,61.840)-=(60,61.840)(61,156.140)+=(61,62.124)-=(61,62.124)(62,155.336)+=(62,60.944)-=(62,60.944)(63,153.868)+=(63,59.996)-=(63,59.996)(64,154.243)+=(64,61.573)-=(64,61.573)(65,156.299)+=(65,60.551)-=(65,60.551)(66,155.569)+=(66,58.158)-=(66,58.158)(67,160.299)+=(67,58.813)-=(67,58.813)(68,163.249)+=(68,57.448)-=(68,57.448)(69,163.121)+=(69,58.308)-=(69,58.308)(70,163.117)+=(70,59.797)-=(70,59.797)(71,160.687)+=(71,59.985)-=(71,59.985)(72,159.729)+=(72,60.022)-=(72,60.022)(73,159.356)+=(73,61.807)-=(73,61.807)(74,157.507)+=(74,58.970)-=(74,58.970)(75,156.925)+=(75,58.859)-=(75,58.859)(76,159.168)+=(76,54.277)-=(76,54.277)(77,164.158)+=(77,52.668)-=(77,52.668)(78,172.283)+=(78,54.742)-=(78,54.742)(79,174.177)+=(79,51.602)-=(79,51.602)(80,178.273)+=(80,52.599)-=(80,52.599)(81,180.454)+=(81,53.622)-=(81,53.622)(82,184.283)+=(82,54.410)-=(82,54.410)(83,179.580)+=(83,52.350)-=(83,52.350)(84,180.243)+=(84,48.510)-=(84,48.510)(85,180.319)+=(85,47.431)-=(85,47.431)(86,178.535)+=(86,48.179)-=(86,48.179)(87,179.896)+=(87,48.532)-=(87,48.532)(88,182.799)+=(88,45.744)-=(88,45.744)(89,183.684)+=(89,44.370)-=(89,44.370)(90,182.891)+=(90,42.702)-=(90,42.702)(91,178.799)+=(91,43.012)-=(91,43.012)(92,177.769)+=(92,44.467)-=(92,44.467)(93,184.186)+=(93,42.660)-=(93,42.660)(94,184.601)+=(94,41.323)-=(94,41.323)(95,182.563)+=(95,43.651)-=(95,43.651)(96,178.976)+=(96,46.911)-=(96,46.911)(97,168.782)+=(97,55.141)-=(97,55.141)(98,166.078)+=(98,55.158)-=(98,55.158)(99,168.017)+=(99,58.878)-=(99,58.878)(100,167.712)+=(100,56.439)-=(100,56.439)(101,168.566)+=(101,62.681)-=(101,62.681)(102,164.440)+=(102,61.769)-=(102,61.769)(103,166.395)+=(103,64.007)-=(103,64.007)};
\end{axis}
\end{tikzpicture}
\caption{aa.}
\label{fig:kickPositions}
\end{figure*}
Best Answer
Thanks to Torbjørn T, using the
fillbetween
, I got it looking like matlab (I also cut the standard deviation in half for better readability)!Here's the code for a single plot, if anyone wants to check it out: