@empet thanks for getting back to me.
For context, my sphere is the probability density of a 3D multi-variate distribution such that X, Y and Z are all mu = 0 and the covariance matrix is [[1,0,0], [0,1,0], [0,0,1]] returning the function, pdf(x,y,z):
def _probability_density(mu, coordinates):
"""Calculate the probability density of a 3D normal gaussian distribution.
3 variables uncorrelated so covariance matrix = [[1, 0, 0], [0, 1, 0], [0, 0, 1]]"""
pdf = []
for X in coordinates:
pX = (1 / sqrt(2 * pi)) * exp(-(1 / 2) * (X[0] - mu[0]) ** 2) * (1 / sqrt(2 * pi)) * exp(
-(1 / 2) * (X[1] - mu[1]) ** 2) * (1 / sqrt(2 * pi)) * exp(-(1 / 2) * (X[2] - mu[2]) ** 2)
pdf.append(pX)
return pdf
pdf_analytical = _probability_density(mu=[0,0,0], coordinates)
Where the coordinates are basically all of the (x,y,z) coordinates in a (64, 64, 64) grid.
I am then plotting a constant probability density. ** In the screenshots below I am also showing an additional surface which is a KDE pdf density estimate.
In terms of my current code (giving the “cut off” surface on x-axis) here it is:
isosurface_analytical = go.Isosurface(x=x_,
y=y_,
z=z_,
value=pdf_analytical,
opacity=0.1,
isomin=levels[0],
isomax=levels[0],
surface=dict(count=1,
fill=1,
pattern="all",
show=True),
colorscale=[[0, "rgb(220,20,60)"], [1.0, "rgb(220,20,60)"]],
caps=dict(x_show=True,
y_show=True,
z_show=True),
showscale=False,
showlegend=False
)
I tried changing x_show, y_show and z_show to False as mentioned but I got this:
re the radius of the isosurface, given that when plotting it in normal plotly it is fine Id assume that it is within the [-d, d].
It does just seem that the surface is being cut off at the x-axis, here is a better screenshot:
I also tried manually making all of my axes [-5, 5] and it was still cut off.