  Let $p\ge 3$ be a prime, $S\subseteq\mathbb F_p^2$ a nonempty set, and
$w\colon\mathbb F_p^2\to\mathbb R$ a function with $\mathrm{supp}\, w=S$.
Applying an uncertainty inequality due to Andr\'as Bir\'o and the present
author, we show that there are at most $\frac12|S|$ directions in $\mathbb
F_p^2$ such that for every line $l$ in any of these directions, one has
  $$ \sum_{z\in l} w(z) = \frac1p\sum_{z\in\mathbb F_p^2} w(z), $$ except if
$S$ itself is a line and $w$ is constant on $S$ (in which case all, but one
direction have the property in question). The bound $\frac12|S|$ is sharp.
  As an application, we give a new proof of a result of R\'edei-Megyesi about
the number of directions determined by a set in a finite affine plane.
