Regarding your caption problem. I don't get any error. I would suspect that your caption.sty is too old.
I have caption.sty 2010/01/09 v3.1m Customizing captions (AR)
The quick fix is to stay away from the part that makes the data explode. Hence if you provide the key domain=0:2.5
it works without any errors.
Initially I thought: The problem comes from the fact that the default domain of plotting the functions is ( as egreg mentioned) [-5,5]. Since negative numbers make the exponential term explode, (the first instance gives e^125 ).
However it gets weirder which makes me think that this is not just an overflow problem. For example starting from -5, using domain=-5:2
it gives the mentioned error but when this key is given as domain=-2.4:2
up to domain=-2.369:2
it gives this
\pgfplotsset{width=0.8\textwidth, height=0.6\textwidth}
\pgfplotsset{samples=200}
\begin{tikzpicture}
\begin{axis}[no marks, style=solid,
enlargelimits=false,
xmin=-5,xmax = 2.5,
ymin=0,ymax = 5,domain=-2.369:2]
%
\addplot gnuplot{3*(x**(3-1))*exp(-x**3)};
%
\end{axis}
\end{tikzpicture}
![enter image description here](https://i.stack.imgur.com/t61Jm.png)
Notice how the ymax
is violated. Also if I try to increase the ymax
value, it gives me a Dimension too large error
. Even weirder, it starts to give Dimension too large
error when we go past -2.369 towards higher values. But if I remove the ymax
option completely I get
![enter image description here](https://i.stack.imgur.com/ZCPVz.png)
So after seeing that I've removed the ymax and let the original code run and I get surprisingly.
![enter image description here](https://i.stack.imgur.com/sgVEz.png)
I guess something is choked during the axis limit calculation. So it might be a bug or an internal limitation.
Best Answer
The
unable to load picture or PDF file
error is a clue that something's wrong, not on the TeX side but on the filesystem side. Possible causes include a corrupted image file, a permissions-protected image file, or a nonexistent image file. Thedivision by 0
error is secondary to the first: TeX is trying to draw a box without having dimensions to form its corners.If you can open and view the image with a previewer then it's likely the problem is not with the file itself (or its permissions, since TeX is running as you). So I guessed the nonexistent file, i.e., bad file name. Knowing that Dropbox usually doesn't mount at the top level of the file system was another clue that the path was wrong.
cfr's check that this is the problem is worth repeating.
It's another example of how simplifying the non-compiling document down to the barest bones can isolate the error.