matplotlib.pyplot.xlim()、ylim()、axis()结构及用法||参数详解

  • matplotlib.pyplot.xlim() 官方文档

matplotlib.pyplot.xlim(*args, **kwargs)

获取或者是设定x座标轴的范围,当前axes上的座标轴。

有两种参数输入方式

  1. plt.xlim(num1, num2)
    

matplotlib.pyplot.xlim()、ylim()、axis()结构及用法||参数详解_第1张图片

  1. plt.xlim(xmin=num1,xmax=num2)
    

matplotlib.pyplot.xlim()、ylim()、axis()结构及用法||参数详解_第2张图片

  • matplotlib.pyplot.ylim 官方文档

内容与x一样

  • matplotlib.pyplot.axis 官方文档

matplotlib.pyplot.axis(*v, **kwargs)

参数详解:

  1. xmin, xmax, ymin, ymax : float, optional

  2. option : str

    Value Description
    ‘on’ Turn on axis lines and labels.
    ‘off’ Turn off axis lines and labels.
    ‘equal’ Set equal scaling (i.e., make circles circular) by changing axis limits.
    ‘scaled’ Set equal scaling (i.e., make circles circular) by changing dimensions of the plot box.
    ‘tight’ Set limits just large enough to show all data.
    ‘auto’ Automatic scaling (fill plot box with data).
    ‘normal’ Same as ‘auto’; deprecated.
    ‘image’ ‘scaled’ with axis limits equal to data limits.
    ‘square’ Square plot; similar to ‘scaled’, but initially forcing xmax-xmin = ymax-ymin.
  3. emit : bool, optional, default True

matplotlib.pyplot.xlim()、ylim()、axis()结构及用法||参数详解_第3张图片

你可能感兴趣的:(小白学Python)