Hi,
It appears that you are working on plotting semi-ellipsoids around clustered points in a 3D space. Based on the provided information, possible reasons for the axis issues could be incorrect centering ofsemi-ellipsoids with respect to cluster points and unequal scaling on axes. Additionally, there may be instances where parts of the ellipsoids are cut off, or the plot is zoomed too far in or out.
Please go through the following steps that can help in addressing the axis issues you have mentioned:
- Iterate over each cluster point to plot the semi-ellipsoids. Use the center coordinates (xc, yc, zc) of each semi-ellipsoid to translate it from the origin to the appropriate position.
Please go through the following example code snippet, which includes a for loop that iterates over the cluster points and, uses their coordinates to center the semi-ellipsoid:
for i = 1:size(cluster_points, 1)
xc = cluster_points(i, 1);
yc = cluster_points(i, 2);
zc = cluster_points(i, 3);
x = a*sin(theta).*cos(phi) + xc;
y = b*sin(theta).*sin(phi) + yc;
surf(x, y, z, 'FaceColor', 'blue', 'FaceAlpha', 0.2, 'EdgeColor', 'none');
- Ensure consistent scaling across axes with ‘axis equal’; to maintain the correct aspect ratio.
- Adjust the axes limits to accommodate all semi-ellipsoids and points based on the positions of the cluster points and the dimensions of the semi-ellipsoids.
Please go through following example code snippet to set the axes limits:
xlim([min(cluster_points(:,1))-a, max(cluster_points(:,1))+a]);
ylim([min(cluster_points(:,2))-b, max(cluster_points(:,2))+b]);
zlim([min(cluster_points(:,3)), max(cluster_points(:,3))+c]);
By Implementing these suggestions, you can successfully plot the semi-ellipsoids around each cluster point as shown in the image attached below.
I hope the information provided above is helpful in resolving your issue.