开发者

Matplotlib - changing plot size within rectangular grid

开发者 https://www.devze.com 2023-01-10 07:03 出处:网络
I have 4 subplots (created by using add_subplot) organised in a 2x2 rectangular grid. The two in the second row do not need to take up as much space and I wish to change it such that the top row t开发

I have 4 subplots (created by using add_subplot) organised in a 2x2 rectangular grid. The two in the second row do not need to take up as much space and I wish to change it such that the top row t开发者_JAVA技巧akes up two thirds of the space and the bottom row takes up the remaining third.

I've found that you can arbitrarily place subplots by creating them with the axes function that takes a list of [top, left, width, height], but this would make the code a little messy and arbitrary.

Is there a "nice" way to do it? Or will I have to resort to individually placing each subplot?


Use subplot2grid, where you specify a 3x3 grid but make subplots in the first row have rowspan=2.


Maybe AxisGrid toolkit will help. It seems to offer more control than subplot()

0

精彩评论

暂无评论...
验证码 换一张
取 消