'Masking a TriContourplot

from matplotlib import pyplot as plt
import pandas as pd
import numpy as np
import cmcrameri.cm as cmc

A = np.array(pd.read_csv(r"C:/Users/thami/export.csv", skiprows=6))

x = A[:, 0]
y = A[:, 1]
z = A[:, 2]
T = A[:, 3]

plt.axis(False)
plt.xlabel("X")
plt.ylabel("Z")
plt.tricontourf(x, z, T, cmap=cmc.batlow)

I get this Contour Plot (Arrow mark points to the masking region)

I have 3D data of a variable T with value at each point (x,y,z) and plotting a 2D plane contour using tricontourf as I have three 1D arrays.

I want to mask that circular portion (of radius, say r) using the mask feature. Can someone help me with how to go about this?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source