I want to create surface plots over certain special domains, e.g., the L-shaped domain below. Currently, I am creating surface plots with matplotlib.pyplot in the typical way, i.e., creating a meshgrid, calculating the values there, setting the values outside the L-shaped domain to 0 and then using
fig, ax = plt.subplots(subplot_kw={"projection": "3d"})
surf = ax.plot_surface(X, Y, Z, cmap=cm.coolwarm,
linewidth=0, antialiased=False)
In this way I obtain plots like the one on the left. However, I would like to get plots like the one on the right, where I only show the values on the L-shaped domain itself and do not have to "pad" with zero. Is there any possibility to do this with matplotlib.pyplot? Any help would be greatly appreciated.