本文整理汇总了Python中matplotlib.axes.Axes.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Axes.__init__方法的具体用法?Python Axes.__init__怎么用?Python Axes.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类matplotlib.axes.Axes
的用法示例。
在下文中一共展示了Axes.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from matplotlib.axes import Axes [as 别名]
# 或者: from matplotlib.axes.Axes import __init__ [as 别名]
def __init__(self, fig, rect=None, *args, **kwargs):
if rect is None:
rect = [0.0, 0.0, 1.0, 1.0]
self.fig = fig
self.cids = []
azim = kwargs.pop("azim", -60)
elev = kwargs.pop("elev", 30)
self.xy_viewLim = unit_bbox()
self.zz_viewLim = unit_bbox()
self.xy_dataLim = unit_bbox()
self.zz_dataLim = unit_bbox()
# inihibit autoscale_view until the axises are defined
# they can't be defined until Axes.__init__ has been called
self.view_init(elev, azim)
self._ready = 0
Axes.__init__(self, self.fig, rect, frameon=True, xticks=[], yticks=[], *args, **kwargs)
self.M = None
self._ready = 1
self.mouse_init()
self.create_axes()
self.set_top_view()
self.axesPatch.set_linewidth(0)
self.fig.add_axes(self)
示例2: __init__
# 需要导入模块: from matplotlib.axes import Axes [as 别名]
# 或者: from matplotlib.axes.Axes import __init__ [as 别名]
def __init__(self, fig, rect=None, **kwargs):
if rect == None:
rect = [0.1,0.1,0.8,0.8]
self.season = kwargs.pop('season',1)
self.ra_direction = kwargs.pop('ra_direction',1)
# center coordinate in (RA, Dec)
self.center = get_kepler_center(season=self.season)
# self.center must be set before Axes.__init__, because Axes.__init__
# calls axes.cla(), which in turns calls set_ylim(), which is
# overwritten in this class.
self.ref_dec1, self.ref_dec2 = 20., 50.
Axes.__init__(self, fig, rect, **kwargs)
# prepare for the draw the ticks on the top & right axis
self.twiny = self.twiny()
self.twinx = self.twinx()
#self.set_aspect(1.0)
self.set_ra_ticks(5)
self.set_dec_ticks(5)
self.set_lim(self.center[0]-11, self.center[0]+11,
self.center[1]-9, self.center[1]+9)
示例3: __init__
# 需要导入模块: from matplotlib.axes import Axes [as 别名]
# 或者: from matplotlib.axes.Axes import __init__ [as 别名]
def __init__(self, fig, rect, *args, **kwargs):
self.aln = kwargs.pop("aln")
nrows = len(self.aln)
ncols = self.aln.get_alignment_length()
self.alnidx = numpy.arange(ncols)
self.app = kwargs.pop("app", None)
self.showy = kwargs.pop('showy', True)
Axes.__init__(self, fig, rect, *args, **kwargs)
rgb = mpl_colors.colorConverter.to_rgb
gray = rgb('gray')
d = defaultdict(lambda:gray)
d["A"] = rgb("red")
d["a"] = rgb("red")
d["C"] = rgb("blue")
d["c"] = rgb("blue")
d["G"] = rgb("green")
d["g"] = rgb("green")
d["T"] = rgb("yellow")
d["t"] = rgb("yellow")
self.cmap = d
self.selector = RectangleSelector(
self, self.select_rectangle, useblit=True
)
def f(e):
if e.button != 1: return True
else: return RectangleSelector.ignore(self.selector, e)
self.selector.ignore = f
self.selected_rectangle = Rectangle(
[0,0],0,0, facecolor='white', edgecolor='cyan', alpha=0.3
)
self.add_patch(self.selected_rectangle)
self.highlight_find_collection = None
示例4: __init__
# 需要导入模块: from matplotlib.axes import Axes [as 别名]
# 或者: from matplotlib.axes.Axes import __init__ [as 别名]
def __init__(self, *args, **kwargs):
self.ra_0 = None
self.dec_0 = None
self.dec_1 = None
self.dec_2 = None
Axes.__init__(self, *args, **kwargs)
self.cla()
示例5: __init__
# 需要导入模块: from matplotlib.axes import Axes [as 别名]
# 或者: from matplotlib.axes.Axes import __init__ [as 别名]
def __init__(self, *args, **kwargs):
"""
Create a new Polar Axes for a polar plot.
"""
self._rpad = 0.05
self.resolution = kwargs.pop('resolution', self.RESOLUTION)
Axes.__init__(self, *args, **kwargs)
self.set_aspect('equal', adjustable='box', anchor='C')
self.cla()
示例6: __init__
# 需要导入模块: from matplotlib.axes import Axes [as 别名]
# 或者: from matplotlib.axes.Axes import __init__ [as 别名]
def __init__(self, *args, **kwargs):
self._memmap = kwargs.pop('memmap')
self._sample_rate = kwargs.pop('sample_rate')
self._num_samples = kwargs.pop('num_samples')
limits = kwargs.pop('limits')
self._limits = self._get_buffer_bounds(*limits)
self._scale = kwargs.pop('scale', self.default_scale)
self._pixel_density = kwargs.pop('pixel_density',
self.default_pixel_density)
Axes.__init__(self, *args, **kwargs)
self._reload_buffer()
示例7: __init__
# 需要导入模块: from matplotlib.axes import Axes [as 别名]
# 或者: from matplotlib.axes.Axes import __init__ [as 别名]
def __init__(self, *args, **kwargs):
"""
Create a new Polar Axes for a polar plot.
"""
self._default_theta_offset = kwargs.pop('theta_offset', 0)
self._default_theta_direction = kwargs.pop('theta_direction', 1)
self._default_rlabel_position = kwargs.pop('rlabel_position', 22.5)
Axes.__init__(self, *args, **kwargs)
self.set_aspect('equal', adjustable='box', anchor='C')
self.cla()
示例8: __init__
# 需要导入模块: from matplotlib.axes import Axes [as 别名]
# 或者: from matplotlib.axes.Axes import __init__ [as 别名]
def __init__(self, fig, rect, tf=None, *args, **kwargs):
self.root = None
self.tf = tf
self.plottype = kwargs.pop("plottype", "phylogram")
self.app = kwargs.pop("app", None)
self.support = kwargs.pop("support", 70.0)
self.scaled = kwargs.pop("scaled", True)
self._mark_named = kwargs.pop("mark_named", True)
self.name = None
self.leaf_fontsize = kwargs.pop("leaf_fontsize", 10)
self.branch_fontsize = kwargs.pop("branch_fontsize", 10)
self.branch_width = kwargs.pop("branch_width", 1)
self.branch_color = kwargs.pop("branch_color", "black")
self.interactive = kwargs.pop("interactive", True)
self.leaflabels = kwargs.pop("leaflabels", True)
self.branchlabels = kwargs.pop("branchlabels", True)
self.direction = kwargs.pop("direction", "rightwards")
self.leaf_anchor = "left" if self.direction == "rightwards" else "right"
self.branch_anchor = self.leaf_anchor
## if self.decorators:
## print >> sys.stderr, "got %s decorators" % len(self.decorators)
self.xoff = kwargs.pop("xoff", 0)
self.yoff = kwargs.pop("yoff", 0)
self.smooth_xpos = kwargs.pop("smooth_xpos", 0)
Axes.__init__(self, fig, rect, *args, **kwargs)
self.nleaves = 0
self.pan_start = None
self.selector = RectangleSelector(self, self.rectselect,
useblit=True)
self._active = False
def f(e):
if e.button != 1: return True
else: return RectangleSelector.ignore(self.selector, e)
self.selector.ignore = f
self.xoffset_value = 0.05
self.selected_nodes = set()
# self.leaf_offset = 4
# self.leaf_valign = "center"
# self.leaf_halign = "left"
# self.branch_offset = -5
# self.branch_valign = "center"
# self.branch_halign = "right"
self.spines["top"].set_visible(False)
self.spines["left"].set_visible(False)
self.spines["right"].set_visible(False)
self.xaxis.set_ticks_position("bottom")
self.node2label = {}
self.label_extents = {}
self.leaf_pixelsep
示例9: __init__
# 需要导入模块: from matplotlib.axes import Axes [as 别名]
# 或者: from matplotlib.axes.Axes import __init__ [as 别名]
def __init__(self, *args, **kwargs):
'''Create the axes.
Should not be used directly, but via the matplotlib ``projection``
keyword argument.
Parameters
==========
arena : :class:`~gridcells.core.arena.Arena`
Are that will be used for plotting. This has to be specified as a
keyword argument to matplotlib's :meth:`Figure.add_subplot` or
:meth:`Figure.add_axes`.
'''
self._arena = kwargs.pop('arena')
MplAxes.__init__(self, *args, **kwargs)
示例10: __init__
# 需要导入模块: from matplotlib.axes import Axes [as 别名]
# 或者: from matplotlib.axes.Axes import __init__ [as 别名]
def __init__(self, fig, rect=None, *args, **kwargs):
'''
Build an :class:`Axes3D` instance in
:class:`~matplotlib.figure.Figure` *fig* with
*rect=[left, bottom, width, height]* in
:class:`~matplotlib.figure.Figure` coordinates
Optional keyword arguments:
================ =========================================
Keyword Description
================ =========================================
*azim* Azimuthal viewing angle (default -60)
*elev* Elevation viewing angle (default 30)
================ =========================================
'''
if rect is None:
rect = [0.0, 0.0, 1.0, 1.0]
self._cids = []
self.initial_azim = kwargs.pop('azim', -60)
self.initial_elev = kwargs.pop('elev', 30)
self.xy_viewLim = unit_bbox()
self.zz_viewLim = unit_bbox()
self.xy_dataLim = unit_bbox()
self.zz_dataLim = unit_bbox()
# inihibit autoscale_view until the axes are defined
# they can't be defined until Axes.__init__ has been called
self.view_init(self.initial_elev, self.initial_azim)
self._ready = 0
Axes.__init__(self, fig, rect,
frameon=True,
*args, **kwargs)
# Disable drawing of axes by base class
Axes.set_axis_off(self)
self._axis3don = True
self.M = None
self._ready = 1
self.mouse_init()
self.set_top_view()
self.axesPatch.set_linewidth(0)
self.figure.add_axes(self)
示例11: __init__
# 需要导入模块: from matplotlib.axes import Axes [as 别名]
# 或者: from matplotlib.axes.Axes import __init__ [as 别名]
def __init__(self, *args, **kwargs):
r"""Initialize `SkewXAxes`.
Parameters
----------
args : Arbitrary positional arguments
Passed to :class:`matplotlib.axes.Axes`
position: int, optional
The rotation of the x-axis against the y-axis, in degrees.
kwargs : Arbitrary keyword arguments
Passed to :class:`matplotlib.axes.Axes`
"""
# This needs to be popped and set before moving on
self.rot = kwargs.pop('rotation', 30)
Axes.__init__(self, *args, **kwargs)
示例12: __init__
# 需要导入模块: from matplotlib.axes import Axes [as 别名]
# 或者: from matplotlib.axes.Axes import __init__ [as 别名]
def __init__(self, *args, **kwargs):
# Sum of a, b, and c
self.total = 1.0
# Offset angle [deg] of these axes relative to the c, a axes.
self.angle = self.get_angle()
# Height of the ternary outline (in axis units)
self.height = 0.8
# Vertical distance between the y axis and the base of the ternary plot
# (in axis units)
self.elevation = 0.05
Axes.__init__(self, *args, **kwargs)
self.cla()
self.set_aspect(aspect='equal', adjustable='box-forced', anchor='C') # C is for center.
示例13: __init__
# 需要导入模块: from matplotlib.axes import Axes [as 别名]
# 或者: from matplotlib.axes.Axes import __init__ [as 别名]
def __init__(self, fig, rect, transform=IDENTITY, xcoord_type='scalar', ycoord_type='scalar', adjustable='datalim', parent=None):
self.fig = fig
self.rect = rect
self._parent = parent
Axes.__init__(self, fig, rect, adjustable=adjustable)
self.xaxis.set_ticks_position('bottom')
self.yaxis.set_ticks_position('left')
fig.add_axes(self)
self.twin = ParasiteAxes(fig, rect, self)
self.other = {}
self.set_transform(transform=transform, xcoord_type=xcoord_type, ycoord_type=ycoord_type)
示例14: __init__
# 需要导入模块: from matplotlib.axes import Axes [as 别名]
# 或者: from matplotlib.axes.Axes import __init__ [as 别名]
def __init__(self, *args, **kwargs):
'''
Builds a new :class:`SmithAxes` instance. For futher details see:
:meth:`update_scParams`
:class:`matplotlib.axes.Axes`
'''
self.scParams = self.scDefaultParams.copy()
# get parameter for Axes and remove from kwargs
axes_kwargs = {}
for key in kwargs.copy():
key_dot = key.replace("_", ".")
if not (key_dot in self.scParams):
axes_kwargs[key] = kwargs.pop(key_dot)
self.update_scParams(**kwargs)
Axes.__init__(self, *args, **axes_kwargs)
self.set_aspect(1, adjustable='box', anchor='C')
示例15: __init__
# 需要导入模块: from matplotlib.axes import Axes [as 别名]
# 或者: from matplotlib.axes.Axes import __init__ [as 别名]
def __init__(self, fig, rect, *args, **kwargs):
self.app = kwargs.pop("app", None)
self.support = kwargs.pop("support", 70.0)
self.snap = kwargs.pop("snap", True)
self.scaled = kwargs.pop("scaled", True)
self.leaflabels = kwargs.pop("leaflabels", True)
self.branchlabels = kwargs.pop("branchlabels", True)
self._mark_named = kwargs.pop("mark_named", True)
self.name = None
Axes.__init__(self, fig, rect, *args, **kwargs)
self.nleaves = 0
self.callbacks.connect("ylim_changed", self.draw_labels)
self.highlighted = None
self.highlightpatch = None
self.pan_start = None
self.decorators = {
"__selected_nodes__": (Tree.highlight_selected_nodes, [], {})
}
self.decorations = Storage()
self._active = False
self.selector = RectangleSelector(self, self.rectselect, useblit=True)
def f(e):
if e.button != 1: return True
else: return RectangleSelector.ignore(self.selector, e)
self.selector.ignore = f
self.xoffset_value = 0.05
self.selected_nodes = set()
self.leaf_offset = 4
self.leaf_valign = "center"
self.leaf_halign = "left"
self.leaf_fontsize = 10
self.branch_offset = -5
self.branch_valign = "center"
self.branch_halign = "right"
self.branch_fontsize = 10
self.spines["top"].set_visible(False)
self.spines["left"].set_visible(False)
self.spines["right"].set_visible(False)
self.xaxis.set_ticks_position("bottom")