Default brew gnuplot installation on Mojave is broken. The best way to solve this problem would be to install a custom "tap" with a working formula, as described here: https://docs.brew.sh/How-to-Create-and-Maintain-a-Tap
If you just want a quick solution: the following manual recompilation with necessary options works just fine. Here's what brew was reporting for me when installing gnuplot:
$ brew reinstall gnuplot
==> Reinstalling gnuplot
==> Downloading https://downloads.sourceforge.net/project/gnuplot/gnuplot/5.2.7/gnuplot-5.2.7.tar.gz
==> Downloading from https://versaweb.dl.sourceforge.net/project/gnuplot/gnuplot/5.2.7/gnuplot-5.2.7.tar.gz
######################################################################## 100.0%
==> ./configure --disable-silent-rules --prefix=~/brew/Cellar/gnuplot/5.2.7_1 --with-readline=~/brew/opt/readline --without-tutorial --disable-wxwidgets --with-qt --without-x
==> make
==> make install
~/brew/Cellar/gnuplot/5.2.7_1: 48 files, 2.9MB, built in 1 minute 47 seconds
Uninstall gnuplot, download the package, configure it to your liking and reinstall manually to the brew location:
brew uninstall gnuplot
### Downloading sources
mkdir ~/src
cd ~/src
wget https://downloads.sourceforge.net/project/gnuplot/gnuplot/5.2.7/gnuplot-5.2.7.tar.gz
tar zxvf gnuplot-5.2.7.tar.gz
cd gnuplot-5.2.7
### Configuring with x11
./configure --disable-silent-rules --prefix=~/brew/Cellar/gnuplot/5.2.7_1 --with-readline=~/brew/opt/readline --without-tutorial --with-cairo --with-qt --with-x
### Uninstall gnuplot from brew and install the substitute
make -j
make install # installs to the same location where brew would
brew link gnuplot