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

博客介绍了matplotlib.pyplot.xlim()、matplotlib.pyplot.ylim()和matplotlib.pyplot.axis()的官方文档内容。xlim()用于获取或设定x坐标轴范围,ylim()内容与xlim()类似,还对axis()的参数进行了详解。
该文章已生成可运行项目,
matplotlib.pyplot.xlim(*args, **kwargs)

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

有两种参数输入方式

  1. plt.xlim(num1, num2)
    

在这里插入图片描述

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

在这里插入图片描述

内容与x一样

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

参数详解:

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

  2. option : str

    ValueDescription
    ‘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

在这里插入图片描述

本文章已经生成可运行项目
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值