We use the concept of set centroid to study the value distribution of $L$-functions in the (extended) Selberg class, which shows how an $L$-function and a meromorphic function are uniquely determined by their two sharing sets. The results in this paper extend Theorem 1 in Li [A result on value distribution of $L$-functions, Proc. Amer. Math. Soc. 138 (2010), 2071--2077]. In addition, we show the accuracy of the results by giving some examples.