Changing size of matplotlib subplots

后端 未结 1 1162
难免孤独
难免孤独 2021-01-23 01:25

Is there an easy way to modify this code so that the plots are bigger without changing the scale on the axes?

import numpy as np
import matplotlib.pyplot as plt
         


        
相关标签:
1条回答
  • 2021-01-23 02:03

    The subplots are shrunk such that their aspect is equal. This seems to be desired; and thus it is not really clear what "bigger" refers to.

    You can still make the figure larger, e.g.

    plt.figure(1, figsize=(12,2))
    

    and then adjust the margins and spacings using plt.subplots_adjust.

    You can also let the axes scale and only set the equal aspect to the data,

    plt.gca().set_aspect('equal', adjustable='datalim')
    

    Finally plotting the subplots beneath each other makes them bigger as well. So you might use plt.subplot(211) and plt.subplot(212).

    0 讨论(0)
提交回复
热议问题