My goal is to plot 3D data (x,y,z coordinates) such that a certain path on/inside a unit ball is illustrated. Since the path will not only be on the surface of the unit ball I have to encode the norm of $(x,y,z)$ as color. Plotting the path alone works quite well using pgfplots. The output file format should be eps/pdf (preferably eps). Here is a link to pastebin, where I have put some example data (example.dat).
Currently I am using the code
\documentclass{article}
\usepackage{pgfplots}
\usepackage{fullpage}
\pgfplotsset{compat=1.10}
\tikzset{mark size=.5}
\usetikzlibrary{arrows,shapes.misc,shapes.arrows,chains,matrix,positioning,scopes,decorations.pathmorphing,shadows,patterns,}
\pagestyle{empty}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
axis lines=center,
ticks=none,
xmin=-1,xmax=1,
ymin=-1,ymax=1,
zmin=-1,zmax=1
]
\addplot3[scatter,scatter src=explicit] file {example.dat};
\end{axis}
\end{tikzpicture}
\end{document}
which shows the colored data as I want (neglecting labels). I am not able to include a sphere for better visualization. The sphere+path should look somewhat like this(except labels/nodes).
The sphere should preferably look like in the link above (shaded) but something like in this answer would also be okay with fewer grid lines (like 3-4). I tried to add the plot from the answer but I do not get the opacity at all, even if I compile only the answer code itself.
I compile my figures using the following bash script
#!/bin/bash
# Give name of .tex file as argument to the command prompt (./compileFigure name_of_tex)
latex $1.tex
dvips -E $1.dvi -o temp.eps
epstool --copy --bbox temp.eps $1.eps
rm *.aux *.log *.dvi temp.eps
What am I missing here to achieve the desired output?
epstool. Have you tried to omitepstool? Does the problem appear withpdflatexas well? – Christian Feuersänger Aug 07 '15 at 22:00pdflatex myfile.tex. Sorry, forgot to mention that in my question – Lukas Aug 08 '15 at 11:57pdflatex. I will put the working code as an answer – Lukas Aug 09 '15 at 08:48