在python中有关函数的表达正确的是_如何在python中查找有关函数的信息?

在ipython中,它的超简单功能只是将?(或者??用于源代码的扩展信息)附加到所讨论的函数中。你知道吗

在matplotlib中交互工作时,我总是使用它:In [2]: from matplotlib.axes import Axes

In [3]: Axes.set_position??

Type: instancemethod

String Form:

File: /home/tzelleke/.local/modules/active_python_2.7/lib/python2.7/site-packages/matplotlib/axes.py

Definition: Axes.set_position(self, pos, which='both')

Source:

def set_position(self, pos, which='both'):

"""

Set the axes position with::

pos = [left, bottom, width, height]

in relative 0,1 coords, or *pos* can be a

:class:`~matplotlib.transforms.Bbox`

There are two position variables: one which is ultimately

used, but which may be modified by :meth:`apply_aspect`, and a

second which is the starting point for :meth:`apply_aspect`.

Optional keyword arguments:

*which*

========== ====================

value description

========== ====================

'active' to change the first

'original' to change the second

'both' to change both

========== ====================

"""

if not isinstance(pos, mtransforms.BboxBase):

pos = mtransforms.Bbox.from_bounds(*pos)

if which in ('both', 'active'):

self._position.set(pos)

if which in ('both', 'original'):

self._originalPosition.set(pos)

In [4]:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值