Numpy XYZ Scatter 3d autoscale_xyz

I have a numpy matrix (100 000 x 3) each lines correspond to coordonnates XYZ of one point. When I try to plot it in 3D, I am using Axe3d,. Scatter. After that I have flatten my matrix just before using autoscale_xyz. And show at the end. This graph looks good.

But when I apply minmaxscaller on my XYZ matrix before plot, the autoscale_xyz doesn’t work and the graph doesn’t look good.

Can you help me?

Hi, can you please provide some small sample code that reproduces the issue?


Thanks for your help.
Of course :

from mpl_toolkits.mplot3d import Axes3D
from sklearn.preprocessing import MinMaxScaler, StandardScaler, RobustScaler

fig = plt.figure(figsize=(12, 8))
ax = Axes3D(fig)
ax.scatter(XYZ[:, 0], XYZ[:, 1], XYZ[:,2])
scale = XYZ.flatten() # Auto scale to the mesh size
ax.auto_scale_xyz(scale, scale, scale)

When I do the transformation below and try to plot it with the same script than above, the plot doesn’t make sens.

XYZ_scale = MinMaxScaler().fit_transform(XYZ)