According to the WP definition of MAP:
In Bayesian statistics, a maximum a posteriori probability (MAP) estimate is an estimate of an unknown quantity, that equals the mode of the posterior distribution.
(emphasis added) which, given a posterior $f(\theta \mid x)$, can be defined as:
$$\hat{\theta}_{\mathrm{MAP}}(x) = \underset{\theta}{\operatorname{arg\,max}} \ f(\theta \mid x) $$
As far as I understand it, the mode of a distribution depends on how I construct its histogram (or KDE). This looks to me to be in contradiction with the above definition, where the MAP is the $\theta$ value found for the maximum of the sampled $f(\theta \mid x)$ and does not depend on anything else.
What am I missing?