I am trying to solve the following problem: First I would like to produce a surface plot of a function of two variables (in this particular case this surface has a saddle shape). Then I would like to draw a sphere in the same plot in such a way that the sphere is tangent to the surface at a point that can be specified freely. Achieving the first part was not a problem. For the second part, I have so far been able to place something that at least resembles a sphere somewhere in the plot (see below). However, specifying the position of where to put the sphere seems to be done not in relation to the axes that I am plotting in, but some other reference point (so (0,0) does not put the sphere at the origin of the axes).
Has someone got a suggestion for the following questions:
1) How do I make the bounding line of the ball thinner?
2) To make it look like an actual sphere, how could I add grid lines (like longitude and latitude) that are correctly projected?
3) How do I specify the position relative to the axes?
To achieve my actual goal:
4) In order to make the sphere with a given radius tangent at a user-specified point, I guess I have to calculate the position in the axes coordinate system via some external program (python ideally). How do I get that information into LateX?
5) Is there a way to do all this in python alone and get a vector graphic out that looks as great as what you get with tikz?
Sorry for the long post, but answers to at least 1-3 would be much appreciated.
\documentclass{standalone}
\usepackage{amsmath}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\begin{document}
\begin{tikzpicture}
\begin{axis}
\addplot3 [
surf,
shader=faceted,
samples=25,
domain=-4:4,
y domain=-4:4
] {x^2-y^2};
\filldraw[ball color=white] (-140,1090) circle [radius=0.25cm];
\end{axis}
\end{tikzpicture}
\end{document}