本文整理匯總了Python中matplotlib.axes.Axes.text方法的典型用法代碼示例。如果您正苦於以下問題:Python Axes.text方法的具體用法?Python Axes.text怎麽用?Python Axes.text使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類matplotlib.axes.Axes
的用法示例。
在下文中一共展示了Axes.text方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: xlabel
# 需要導入模塊: from matplotlib.axes import Axes [as 別名]
# 或者: from matplotlib.axes.Axes import text [as 別名]
def xlabel(s, *args, **kwargs):
"""
Set the *x* axis label of the current axis.
Default override is::
override = {
'fontsize' : 'small',
'verticalalignment' : 'top',
'horizontalalignment' : 'center'
}
.. seealso::
:func:`~matplotlib.pyplot.text`
For information on how override and the optional args work
"""
l = gca().set_xlabel(s, *args, **kwargs)
draw_if_interactive()
return l
示例2: ylabel
# 需要導入模塊: from matplotlib.axes import Axes [as 別名]
# 或者: from matplotlib.axes.Axes import text [as 別名]
def ylabel(s, *args, **kwargs):
"""
Set the *y* axis label of the current axis.
Defaults override is::
override = {
'fontsize' : 'small',
'verticalalignment' : 'center',
'horizontalalignment' : 'right',
'rotation'='vertical' : }
.. seealso::
:func:`~matplotlib.pyplot.text`
For information on how override and the optional args
work.
"""
l = gca().set_ylabel(s, *args, **kwargs)
draw_if_interactive()
return l
示例3: figtext
# 需要導入模塊: from matplotlib.axes import Axes [as 別名]
# 或者: from matplotlib.axes.Axes import text [as 別名]
def figtext(*args, **kwargs):
ret = gcf().text(*args, **kwargs)
draw_if_interactive()
return ret
示例4: text
# 需要導入模塊: from matplotlib.axes import Axes [as 別名]
# 或者: from matplotlib.axes.Axes import text [as 別名]
def text(x, y, s, fontdict=None, withdash=False, **kwargs):
ret = gca().text(x, y, s, fontdict=fontdict, withdash=withdash, **kwargs)
draw_if_interactive()
return ret
# This function was autogenerated by boilerplate.py. Do not edit as
# changes will be lost
示例5: get_zlabel
# 需要導入模塊: from matplotlib.axes import Axes [as 別名]
# 或者: from matplotlib.axes.Axes import text [as 別名]
def get_zlabel(self) :
"""
Get the z-label text string.
.. versionadded :: 1.1.0
This function was added, but not tested. Please report any bugs.
"""
label = self.zaxis.get_label()
return label.get_text()
#### Axes rectangle characteristics
示例6: text
# 需要導入模塊: from matplotlib.axes import Axes [as 別名]
# 或者: from matplotlib.axes.Axes import text [as 別名]
def text(self, x, y, z, s, zdir=None, **kwargs):
'''
Add text to the plot. kwargs will be passed on to Axes.text,
except for the `zdir` keyword, which sets the direction to be
used as the z direction.
'''
text = Axes.text(self, x, y, s, **kwargs)
art3d.text_2d_to_3d(text, z, zdir)
return text
示例7: xticks
# 需要導入模塊: from matplotlib.axes import Axes [as 別名]
# 或者: from matplotlib.axes.Axes import text [as 別名]
def xticks(*args, **kwargs):
"""
Get or set the *x*-limits of the current tick locations and labels.
::
# return locs, labels where locs is an array of tick locations and
# labels is an array of tick labels.
locs, labels = xticks()
# set the locations of the xticks
xticks( arange(6) )
# set the locations and labels of the xticks
xticks( arange(5), ('Tom', 'Dick', 'Harry', 'Sally', 'Sue') )
The keyword args, if any, are :class:`~matplotlib.text.Text`
properties. For example, to rotate long labels::
xticks( arange(12), calendar.month_name[1:13], rotation=17 )
"""
ax = gca()
if len(args)==0:
locs = ax.get_xticks()
labels = ax.get_xticklabels()
elif len(args)==1:
locs = ax.set_xticks(args[0])
labels = ax.get_xticklabels()
elif len(args)==2:
locs = ax.set_xticks(args[0])
labels = ax.set_xticklabels(args[1], **kwargs)
else: raise TypeError('Illegal number of arguments to xticks')
if len(kwargs):
for l in labels:
l.update(kwargs)
draw_if_interactive()
return locs, silent_list('Text xticklabel', labels)
示例8: figtext
# 需要導入模塊: from matplotlib.axes import Axes [as 別名]
# 或者: from matplotlib.axes.Axes import text [as 別名]
def figtext(x, y, s, *args, **kwargs):
return gcf().text(x, y, s, *args, **kwargs)
示例9: annotate
# 需要導入模塊: from matplotlib.axes import Axes [as 別名]
# 或者: from matplotlib.axes.Axes import text [as 別名]
def annotate(text, xy, *args, **kwargs):
return gca().annotate(text=text, xy=xy, *args, **kwargs)
# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
示例10: text
# 需要導入模塊: from matplotlib.axes import Axes [as 別名]
# 或者: from matplotlib.axes.Axes import text [as 別名]
def text(x, y, s, fontdict=None, withdash=False, **kwargs):
return gca().text(
x=x, y=y, s=s, fontdict=fontdict, withdash=withdash, **kwargs)
# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
示例11: get_zlabel
# 需要導入模塊: from matplotlib.axes import Axes [as 別名]
# 或者: from matplotlib.axes.Axes import text [as 別名]
def get_zlabel(self):
"""
Get the z-label text string.
.. versionadded :: 1.1.0
This function was added, but not tested. Please report any bugs.
"""
label = self.zaxis.get_label()
return label.get_text()
#### Axes rectangle characteristics
示例12: text
# 需要導入模塊: from matplotlib.axes import Axes [as 別名]
# 或者: from matplotlib.axes.Axes import text [as 別名]
def text(x, y, s, fontdict=None, withdash=False, **kwargs):
return gca().text(x, y, s, fontdict=fontdict, withdash=withdash, **kwargs)
# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
示例13: text
# 需要導入模塊: from matplotlib.axes import Axes [as 別名]
# 或者: from matplotlib.axes.Axes import text [as 別名]
def text(
x, y, s, fontdict=None,
withdash=cbook.deprecation._deprecated_parameter, **kwargs):
return gca().text(x, y, s, fontdict=fontdict, withdash=withdash, **kwargs)
# Autogenerated by boilerplate.py. Do not edit as changes will be lost.