TST, TYP: _use_dynamic_x
This condition (which, from the current plotting test suite, is unreachable) was introduced in #9814, when `_use_dynamic_x` was written.

Is there any reason why `get_period_alias(freq)` would return `None` if `freq` is a valid time frequency? If so, I'll add a test - else, this PR removes unreachable code.

Added an annotation for `data` and the return type while I was here - is there a way to annotate `ax`?

UPDATE
------

As it turns out (thanks jbrockmendel and jorisvandenbossche), this line can be hit, so I've included a test which does