Inverse transition of labyrinthine domain patterns in ferroelectric thin films