the value on y-axis does not change in my plot if I define my function outside ax.plot_wireframe()
.
It is the problem of my real function which longer.
import pandas
import numpy
from matplotlib import cm
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D # <--- This is important for 3d plotting
a = numpy.linspace(1,10,10) # x axis
b = numpy.linspace(1,10,10) # y axis
R = a+b #model function, real function is longer
z = R
fig = plt.figure()
ax = plt.axes(projection='3d')
a,b = numpy.meshgrid(a,b)
#ax.plot_wireframe(a,b,a+b, color='b') #correct
#ax.plot_wireframe(a,b,z, color='b') #wrong
ax.plot_wireframe(a,b,R, color='b') #wrong
ax.set_title('surface');
ax.set_xlabel('x')
ax.set_ylabel('y')
ax.set_zlabel('z');