Suppose you have a ready function, say read_z_from_file(filename), that returns the z-value contained in the file, you could go about it like this:
import numpy as np
x = np.arange(10,20,1, dtype = np.int)
y = np.arange(20,50,1, dtype = np.int)
z = np.zeros((x.shape[0],y.shape[0]))
for i,x0 in enum(x):
for j,y0 in enum(y):
filename = '{}_{}.txt'.format(x0,y0)
z[i,j] = read_z_from_file(filename)
You can then visualise z with imshow or matshow from matplotlib. For instance:
from matplotlib import pyplot as plt
fix,ax = plt.subplots()
ax.imshow(z)
plt.show()
EDIT:
To respond to the questions of the OP, there is a multitude of ways to visualise your data. imshow and matshow do both about the same thing, but differ in the display details. Additionally, you can, among many others, produce contour plots or 3d surfaces. It depends a lot on what you want to see. Anyway, assuming that the code above does what you want, I show below some code that uses four different methods to display the same example data. You can find out more about these different methods with pythons in-built help() function and, of course, the matplotlib and numpy documentation pages.
import numpy as np
from matplotlib import pyplot as plt
from mpl_toolkits.mplot3d import Axes3D ##for the 3d surface plot
from matplotlib import cm
#non-integer spacing of the coordinates
x = np.linspace (10, 20, 15)
y = np.linspace (20, 50, 70)
#gridding the coordinates
xm, ym = np.meshgrid(x,y)
#example data
z = np.exp(-( 0.1*(xm-12)**2 + 0.05*(ym-40)**2 ) )
#opening a figure
fig = plt.figure(figsize=(6,6))
#matshow:
ax1 = fig.add_subplot(221)
res = ax1.matshow(
z,
origin = 'lower',
aspect = 'auto',
extent=[x[0],x[-1],y[0],y[-1]],
)
fig.colorbar(res)
ax1.set_title('matshow', y=1.1)
#imshow
ax2 = fig.add_subplot(222)
res = ax2.imshow(
z,
origin = 'lower',
aspect = 'auto',
extent=[x[0],x[-1],y[0],y[-1]],
)
fig.colorbar(res)
ax2.set_title('imshow')
#contourf
ax3 = fig.add_subplot(223)
res = ax3.contourf(xm,ym,z)
fig.colorbar(res)
ax3.set_title('contourf')
#3d surface
ax4 = fig.add_subplot(224, projection='3d')
res = ax4.plot_surface(
xm,ym,z,
cmap = cm.viridis,
antialiased=False
)
fig.colorbar(res, pad = 0.1)
ax4.set_title('3d surface')
fig.tight_layout()
plt.show()
The final plot looks like this:

x,yandzare of different length, so what exactly do you want to plot? How do you define "depends"?