0

I'm trying to generate a 3d plot from a few datapoints. My goal is it, to compare two different datasets and show how good they match at different points. Right now I'm working on the first surface and my supervisor is unhappy with the visualization.

I use the following code at the moment:

import matplotlib.pyplot as plt
import numpy as np
from mpl_toolkits.mplot3d import axes3d

# Create the figure and axes objects
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')

# Define the data for the first surface
x1 = [25,35,40,45,50,55,60]
y1 = [1300,4000,5000,5400]
z1 = [8.06,5.81,5.10,4.55,4.1,3.01,2.51,6.46,4.93,4.4,4.03,3.15,2.83,2.4,5.95,4.6,3.87,3.19,2.91,2.7,2.36,5.69,4.29,3.63,3.1,2.85,2.65,2.33]

# Convert the z1 data to 2D arrays
x, y = np.meshgrid(x1, y1)
z1 = np.array(z1).reshape(x.shape)

# Plot the first surface
ax.plot_surface(x, y, z1)

# Show the plot
plt.show()



And as a result the following plot is displayed:

enter image description here

My supervisor wants it to look something like this:

enter image description here

Note that this is a completly different diagram with a different dataset and also different axes.

I wonder if it is even possible to generate such a high resolution of a grid with so few datapoints. Has is something to do with the way the points are connected in the diagram? In my diagram it looks like a linear interpolation. Is it possible to influence the interpolation?

I would be glad if anyone has an idea and is able to help me.

Thanks, and all the best!

  • Does this answer your question? [colored wireframe plot in matplotlib](https://stackoverflow.com/questions/15134004/colored-wireframe-plot-in-matplotlib) – Cpt.Hook Dec 12 '22 at 13:43

0 Answers0