I do have a script, which creates a dict with XYZ-values. Following dict includes values at x from -2 to 2, with y from 0 to 2.
my_dict = {
-2:{0:1,1:1,2:0},
-1:{0:3,1:1,2:0},
0:{0:6,1:1,2:9},
1:{0:-2,1:1,2:2},
2:{0:1,1:1,2:6}}
Now, I don't now how to create a 3D plot out of this. I am aware of the matplotlib library,but I am not sure how to generate my Z-Data. I tried to write a function, to get my Z-data in a mesh, but it doesn't work. This is what I got so far:
x = np.arange(-2, 2, 1)
y = np.arange(0, 2, 1)
X, Y = np.meshgrid(x, y)
Z = f(X,Y) #HERE, the function f is what I am searching for.
fig = plt.figure()
ax = plt.axes(projection='3d')
ax.contour3D(X, Y, Z, 50, cmap='binary')
ax.set_xlabel('x')
ax.set_ylabel('y')
ax.set_zlabel('z')
Is there any numpy or pythonic way to do this?