当前位置: 首页>>代码示例>>Python>>正文


Python SubplotZero.set_yticklabels方法代码示例

本文整理汇总了Python中mpl_toolkits.axes_grid.axislines.SubplotZero.set_yticklabels方法的典型用法代码示例。如果您正苦于以下问题:Python SubplotZero.set_yticklabels方法的具体用法?Python SubplotZero.set_yticklabels怎么用?Python SubplotZero.set_yticklabels使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在mpl_toolkits.axes_grid.axislines.SubplotZero的用法示例。


在下文中一共展示了SubplotZero.set_yticklabels方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: make_plot_ax

# 需要导入模块: from mpl_toolkits.axes_grid.axislines import SubplotZero [as 别名]
# 或者: from mpl_toolkits.axes_grid.axislines.SubplotZero import set_yticklabels [as 别名]
def make_plot_ax():
    fig = figure(figsize=(6, 5));
    ax = SubplotZero(fig, 111); fig.add_subplot(ax)
    for direction in ["xzero", "yzero"]:
        ax.axis[direction].set_axisline_style("-|>")
        ax.axis[direction].set_visible(True)
    for direction in ["left", "right", "bottom", "top"]:
        ax.axis[direction].set_visible(False)
    xlim(-0.1, 2.1); ylim(xlim())
    ticks = [0.5 * i for i in range(1, 5)]
    labels = [str(i) if i == int(i) else "" for i in ticks]
    ax.set_xticks(ticks); ax.set_yticks(ticks)
    ax.set_xticklabels(labels); ax.set_yticklabels(labels)
    ax.axis["yzero"].set_axis_direction("left")
    return ax
开发者ID:PaulPGauthier,项目名称:cobrapy,代码行数:17,代码来源:qp.py

示例2: renderGraph

# 需要导入模块: from mpl_toolkits.axes_grid.axislines import SubplotZero [as 别名]
# 或者: from mpl_toolkits.axes_grid.axislines.SubplotZero import set_yticklabels [as 别名]
    def renderGraph(self):  # pylint: disable=R0914
        assert len(self._oData.aoSeries) == 1
        oSeries = self._oData.aoSeries[0]

        # hacking
        # self.setWidth(512);
        # self.setHeight(128);
        # end

        oFigure = self._createFigure()
        from mpl_toolkits.axes_grid.axislines import SubplotZero

        # pylint: disable=E0401
        oAxis = SubplotZero(oFigure, 111)
        oFigure.add_subplot(oAxis)

        # Disable all the normal axis.
        oAxis.axis["right"].set_visible(False)
        oAxis.axis["top"].set_visible(False)
        oAxis.axis["bottom"].set_visible(False)
        oAxis.axis["left"].set_visible(False)

        # Use the zero axis instead.
        oAxis.axis["yzero"].set_axisline_style("-|>")
        oAxis.axis["yzero"].set_visible(True)
        oAxis.axis["xzero"].set_axisline_style("-|>")
        oAxis.axis["xzero"].set_visible(True)

        if oSeries.aoYValues[-1] == 100:
            sColor = "green"
        elif oSeries.aoYValues[-1] > 75:
            sColor = "yellow"
        else:
            sColor = "red"
        oAxis.plot(oSeries.aoXValues, oSeries.aoYValues, ".-", color=sColor, linewidth=3)
        oAxis.fill_between(oSeries.aoXValues, oSeries.aoYValues, facecolor=sColor, alpha=0.5)

        oAxis.set_xlim(left=-0.01)
        oAxis.set_xticklabels([])
        oAxis.set_xmargin(1)

        oAxis.set_ylim(bottom=0, top=100)
        oAxis.set_yticks([0, 50, 100])
        oAxis.set_ylabel("%")
        # oAxis.set_yticklabels([]);
        oAxis.set_yticklabels(["", "%", ""])

        return self._produceSvg(oFigure, False)
开发者ID:svn2github,项目名称:virtualbox,代码行数:50,代码来源:wuihlpgraphmatplotlib.py

示例3: renderGraph

# 需要导入模块: from mpl_toolkits.axes_grid.axislines import SubplotZero [as 别名]
# 或者: from mpl_toolkits.axes_grid.axislines.SubplotZero import set_yticklabels [as 别名]
    def renderGraph(self): # pylint: disable=R0914
        assert len(self._oData.aoSeries) == 1;
        oSeries = self._oData.aoSeries[0];

        # hacking
        #self.setWidth(512);
        #self.setHeight(128);
        # end

        oFigure = self._createFigure();
        from mpl_toolkits.axes_grid.axislines import SubplotZero;
        oAxis = SubplotZero(oFigure, 111);
        oFigure.add_subplot(oAxis);

        # Disable all the normal axis.
        oAxis.axis['right'].set_visible(False)
        oAxis.axis['top'].set_visible(False)
        oAxis.axis['bottom'].set_visible(False)
        oAxis.axis['left'].set_visible(False)

        # Use the zero axis instead.
        oAxis.axis['yzero'].set_axisline_style('-|>');
        oAxis.axis['yzero'].set_visible(True);
        oAxis.axis['xzero'].set_axisline_style('-|>');
        oAxis.axis['xzero'].set_visible(True);

        if oSeries.aoYValues[-1] == 100:
            sColor = 'green';
        elif oSeries.aoYValues[-1] > 75:
            sColor = 'yellow';
        else:
            sColor = 'red';
        oAxis.plot(oSeries.aoXValues, oSeries.aoYValues, '.-', color = sColor, linewidth = 3);
        oAxis.fill_between(oSeries.aoXValues, oSeries.aoYValues, facecolor = sColor, alpha = 0.5)

        oAxis.set_xlim(left = -0.01);
        oAxis.set_xticklabels([]);
        oAxis.set_xmargin(1);

        oAxis.set_ylim(bottom = 0, top = 100);
        oAxis.set_yticks([0, 50, 100]);
        oAxis.set_ylabel('%');
        #oAxis.set_yticklabels([]);
        oAxis.set_yticklabels(['', '%', '']);

        return self._produceSvg(oFigure, False);
开发者ID:swimming198243,项目名称:virtualbox,代码行数:48,代码来源:wuihlpgraphmatplotlib.py

示例4: FourSphereVolumeConductor

# 需要导入模块: from mpl_toolkits.axes_grid.axislines import SubplotZero [as 别名]
# 或者: from mpl_toolkits.axes_grid.axislines.SubplotZero import set_yticklabels [as 别名]
        p = f['CURRENT_DIPOLE_MOMENT'][name]
        
        # four-sphere volume conductor
        sphere = FourSphereVolumeConductor(
            **PSET.foursphereParams
        )
        phi_p += sphere.calc_potential(p=p,
                                       rz=np.array([0, 0, PSET.foursphereParams['radii'][0] + PSET.layer_data['center'][3:][i % 2]]),)

    vlimround = plotting.draw_lineplot(ax=ax, data=plotting.decimate(phi_p, q=PSET.decimate_q)[::-1, ]*1E3, unit=r'$\mu$V', #mV -> µV unit conversion
                              dt=PSET.dt*PSET.decimate_q,
                              T=T, color='k', scalebarbasis='log10')

    ax.set_xticklabels([])
    ax.set_xlabel('')
    ax.set_yticklabels(['{}'.format(i+1) for i in range(sphere.rxyz.shape[0])])
    ax.set_ylabel('position', labelpad=10)

    ax.text(-0.1, 1.05, alphabet[6],
        horizontalalignment='center',
        verticalalignment='center',
        fontsize=16, fontweight='demibold',
        transform=ax.transAxes)




    # PANEL H. tangential component of MEG signal (as recorded by squid outside scull)
    
    # compute the radial unit vector from the center of the sphere to each
    # measurement point, then unit vectors along theta and phi
开发者ID:torbjone,项目名称:LFPy,代码行数:33,代码来源:figure_5.py

示例5: SubplotZero

# 需要导入模块: from mpl_toolkits.axes_grid.axislines import SubplotZero [as 别名]
# 或者: from mpl_toolkits.axes_grid.axislines.SubplotZero import set_yticklabels [as 别名]
from mpl_toolkits.axes_grid.axislines import SubplotZero
import matplotlib.pyplot as plt
import numpy as np


fig = plt.figure(1)
ax = SubplotZero(fig, 111)
fig.add_subplot(ax)

for direction in ["xzero", "yzero"]:
    ax.axis[direction].set_axisline_style("-|>, size=2")
    ax.axis[direction].set_visible(True)
    ax.set_yticklabels([])
    ax.set_xticklabels([])

for direction in ["left", "right", "bottom", "top"]:
    ax.axis[direction].set_visible(False)
ax.axis['xzero'].set_label('asdfsadf')
x = np.linspace(-10, 10, 1000)
ax.plot(x, np.sin(x*np.pi))

plt.show()
开发者ID:dyens,项目名称:python-scripts,代码行数:24,代码来源:arrows.py


注:本文中的mpl_toolkits.axes_grid.axislines.SubplotZero.set_yticklabels方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。