I've plotted a plane passing through the center of the scatter plot but it seems to push the scatter plot to a side. I probably think it is because of the scaling. I am in a dilemma as to how to plot the plane just to the size of the scatter plot.
Here's what I have tried.
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
df=pd.read_csv('wr.csv')
df=df.sample(frac=1)
X=np.linspace(0,df['fixed acidity'].shape)
Y=np.linspace(0,df['fixed acidity'].shape)
x,y=np.meshgrid(X,Y)
z=x*0+y*0+np.mean(np.square(df['fixed acidity']))
fig = plt.figure()
ax = fig.add_subplot(111,projection='3d')
ax.scatter(df.index, df['fixed acidity'], np.square(df['fixed acidity']), s=5,color='black')
ax.scatter(np.mean(df.index),np.mean(df['fixed acidity']),np.mean(np.square(df['fixed acidity'])),color='orange',s=300)
ax.plot_surface(x,y,z,alpha=0.5)
I want the plane passing through the centre and keep the plane the same size as the scatter plot.