setting y-axis limit in matplotlib

后端 未结 9 1822
自闭症患者
自闭症患者 2020-11-22 15:42

I need help with setting the limits of y-axis on matplotlib. Here is the code that I tried, unsuccessfully.

import matplotlib.pyplot as plt

plt.figure(1, fi         


        
9条回答
  •  半阙折子戏
    2020-11-22 16:27

    Your code works also for me. However, another workaround can be to get the plot's axis and then change only the y-values:

    x1,x2,y1,y2 = plt.axis()
    plt.axis((x1,x2,25,250))

提交回复
热议问题