Below you can see the front-view size comparison of the Canon 4000D and Panasonic G9. The Canon 4000D is 8 mm narrower and 15 mm thinner than the Panasonic G9 but it is also 5 mm taller.
The chart below depicts how two cameras compare with average dimensions of the cameras in their class.