Consider a scheme $X$, and an a closed point $x\in X$. I am wondering whether there is an affine open neighborhood $x\in U\subseteq X$ such that $$\dim \mathcal O_{X,x}=\dim U.$$
I tried the following approach: Let $V=\mathrm{spec}(R)$, then $\mathcal O_{X,x}=R_{\mathfrak m_x}$, where $\mathfrak m_x$ is the maximal ideal corresponding to the closed point $x$. Let $f\in R$ with $f\notin \mathfrak m_x$, then $U=\mathrm{spec}(R_f)$ is an open subset of $V$ that contains $x$. As every chain of prime ideals in $R_{\mathfrak m_x}$ is a chain in $R_f$ as well, we have $\dim\mathcal O_{X,x}\leq \dim U$. Unfortunately, I do not understand if we can choose an $f$ for which we obtain equality.
If this is not possible in general, can we prove it for a variety, i.e. an integral, separated scheme of finite type over $\mathbb C$?