title: How do I satisfy or bypass motplotlib's plot_surface argument Z dimension requirements?
body: <p>I've been working on a project involving the boston housing prices dataset in sci-kit learn. I wanted to generate a 3D surfaceplot to show the interactions between 3 variables - two variables that have a strong influence on housing prices, and the housing prices themselves. However, I keep getting stuck on this error that says <code>argument Z must be 2-dimensional</code>.</p>
  <p>Here's the code...</p>
  <pre><code>import numpy as np
  import pandas as pd
  from sklearn.datasets import load_boston
  import matplotlib.pyplot as plt
  from sklearn.model_selection import train_test_split
  from sklearn.linear_model import LinearRegression
  
  boston_dataset = load_boston()
  boston = pd.DataFrame(boston_dataset.data,
                        columns=boston_dataset.feature_names)
  boston['MEDV'] = boston_dataset.target
  
  X = boston[['RM','LSTAT']]
  Y = boston['MEDV']
  
  X_train, X_test, Y_train, Y_test = train_test_split(X, Y,
                                                      test_size = 0.3,
                                                      random_state=1)
  
  model = LinearRegression()
  model.fit(X_train, Y_train)
  
  x_data = boston['RM']
  y_data = boston['LSTAT']
  
  X,Y = np.meshgrid(x_data,y_data)
  Z = model.predict(X_test)
  
  ax = plt.axes(projection=&quot;3d&quot;)
  ax.plot_surface(X,Y,Z,cmap=&quot;plasma&quot;)
  plt.show()
  </code></pre>