Quantiles from histogram? Is it possible to calculate quantiles from a probability histogram P(x) rather than from the data x itself? I have an unbinned histogram for discrete random variables, and I'm wondering if I can calculate the quantiles directly from this.

Just use the definition of the quantile: since you have the probabilities $p_x$ for all possible outcomes $x$ (which I'll assume numerical, since otherwise the concept of a "quantile" makes no sense), for any $p\in(0,1)$, add up the $p_x$ in increasing order of $x$ until you reach a total of $p$. Formally, a quantile $q_p$ for a level $p$ is
$$q_p := \text{min}\bigg\{y\colon \sum_{x\leq y} p_x \geq p\bigg\}.$$
(Actually, this - or something like this, see the remark below - is the definition of the quantile, so it comes logically before any data. Any "sample" quantile derived from observations is an estimate of these quantiles.)
There are variations in the precise definition of quantiles (Hyndman & Fan, 1996), which you can in principle include in your calculation, but which rarely make a decisive difference.
