setting y-axis limit in matplotlib

后端 未结 9 1798
自闭症患者
自闭症患者 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:25

    Try this . Works for subplots too .

    axes = plt.gca()
    axes.set_xlim([xmin,xmax])
    axes.set_ylim([ymin,ymax])
    

提交回复
热议问题