How did the Upper Peninsula end up as part of the state of Michigan rather than Wisconsin?

by bobmanuel22

Looking at a map, it seems like grouping it with Wisconsin makes much more geographical sense than grouping it with mainland Michigan.

SterkBakkie