setting y-axis limit in matplotlib

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

    You can instantiate an object from matplotlib.pyplot.axes and call the set_ylim() on it. It would be something like this:

    import matplotlib.pyplot as plt
    axes = plt.axes()
    axes.set_ylim([0, 1])
    

提交回复
热议问题