Fixed an error when plotting an empty dataset.

This was accidentally introduced by #1200; we can’t assume that
axis.ticks is an array.