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


Python SubplotZero.set_ylabel方法代码示例

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


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

示例1: run

# 需要导入模块: from mpl_toolkits.axes_grid.axislines import SubplotZero [as 别名]
# 或者: from mpl_toolkits.axes_grid.axislines.SubplotZero import set_ylabel [as 别名]
    def run(self, results):
        par = self.getValueOfParameter("parameter")
        i = int(self.getValueOfParameter("iteration number"))
        title = self.getValueOfParameter("title")
        if(par==""):
            return False
        
        if(i >= results.__len__()):
            return False
        
        dialogform = Dialog(QApplication.activeWindow())
        fig = Figure((5.0, 4.0), dpi=100)
        ax = SubplotZero(fig, 1, 1, 1)
        fig.add_subplot(ax)

        for n in ["top", "right"]:
            ax.axis[n].set_visible(False)
            
        for n in ["bottom", "left"]:
            ax.axis[n].set_visible(True)
        
        x = results[i].getResults(par)   
        
        if(not(x.__len__())):
            return False

        ax.hist(x, 100, normed=1)
        ax.set_xlabel('Error')
        ax.set_ylabel('Probability')
        ax.grid(True)
        
        ax.set_title(title)
        dialogform.showFigure(fig)
        return True
开发者ID:iut-ibk,项目名称:Calimero,代码行数:36,代码来源:libresulthandler.py

示例2: renderGraph

# 需要导入模块: from mpl_toolkits.axes_grid.axislines import SubplotZero [as 别名]
# 或者: from mpl_toolkits.axes_grid.axislines.SubplotZero import set_ylabel [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_ylabel [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: draw_graph

# 需要导入模块: from mpl_toolkits.axes_grid.axislines import SubplotZero [as 别名]
# 或者: from mpl_toolkits.axes_grid.axislines.SubplotZero import set_ylabel [as 别名]
    def draw_graph(self):
        min_time = 0
        max_time = 0
        for val in self.readings:
            if min_time == 0:
                min_time = val["time"]
            if val["time"] < min_time:
                min_time = val["time"]
            if max_time == 0:
                max_time = val["time"]
            if val["time"] > max_time:
                max_time = val["time"]
                
        fig = plt.figure(1)

        fig.subplots_adjust(right=0.85)
        ax = SubplotZero(fig, 1, 1, 1)
        fig.add_subplot(ax)
        plt.title("Score for Game: %s" % self.score)
        # make right and top axis invisible
        ax.axis["right"].set_visible(False)
        ax.axis["top"].set_visible(False)

        # make xzero axis (horizontal axis line through y=0) visible.
        ax.axis["xzero"].set_visible(False)

        ax.set_xlim(min_time, max_time)
        ax.set_ylim(0, 4)
        ax.set_xlabel("Time")
        ax.set_ylabel("HRV")

        t_hrv = []
        hrv = []
        for val in self.readings:
            if "hrv" in val.keys():
                t_hrv.append(val["time"])
                hrv.append(val["hrv"])
            else:
                ax.plot(val["time"], 2.0, 'r.')

        for peak in self.peaks:
            ax.plot(peak["time"], peak["hrv"], 'g.', markersize=10)
        ax.plot(t_hrv, hrv, 'b-')

        plt.savefig('pulse_graph')
开发者ID:qdot,项目名称:pulse-project,代码行数:47,代码来源:game.py

示例5: FourSphereVolumeConductor

# 需要导入模块: from mpl_toolkits.axes_grid.axislines import SubplotZero [as 别名]
# 或者: from mpl_toolkits.axes_grid.axislines.SubplotZero import set_ylabel [as 别名]
        
        # 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
    r_hat = (sphere.rxyz.T / sphere.r).T
开发者ID:torbjone,项目名称:LFPy,代码行数:33,代码来源:figure_5.py

示例6: SubplotZero

# 需要导入模块: from mpl_toolkits.axes_grid.axislines import SubplotZero [as 别名]
# 或者: from mpl_toolkits.axes_grid.axislines.SubplotZero import set_ylabel [as 别名]
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid.axislines import SubplotZero
if 1:
    fig = plt.figure(1)
    fig.subplots_adjust(right=0.85)
    ax = SubplotZero(fig, 1, 1, 1)
    fig.add_subplot(ax)
    ax.axis["right"].set_visible(False)
    ax.axis["top"].set_visible(False)
    ax.axis["xzero"].set_visible(True)
    ax.axis["xzero"].label.set_text("Axis Zero")
    ax.set_ylim(-2, 4)
    ax.set_xlabel("Label X")
    ax.set_ylabel("Label Y")
    offset = (20, 0)
    new_axisline = ax.get_grid_helper().new_fixed_axis
    ax.axis["right2"] = new_axisline(loc="right",
                                     offset=offset,
                                     axes=ax)
    ax.axis["right2"].label.set_text("Label Y2")
    ax.plot([-2,3,2])
    plt.draw()
    plt.show()
开发者ID:,项目名称:,代码行数:25,代码来源:

示例7: main

# 需要导入模块: from mpl_toolkits.axes_grid.axislines import SubplotZero [as 别名]
# 或者: from mpl_toolkits.axes_grid.axislines.SubplotZero import set_ylabel [as 别名]
def main():
    f = open("game_output.txt", "r")
    l = json.load(f)
    min_time = 0
    for val in l:
        if min_time == 0:
            min_time = val["time"]
        if val["time"] < min_time:
            min_time = val["time"]
    max_time = 0
    for val in l:
        if max_time == 0:
            max_time = val["time"]
        if val["time"] > max_time:
            max_time = val["time"]

    print "%s %s" % (min_time, max_time)

    fig = plt.figure(1)
    fig.subplots_adjust(right=0.85)
    ax = SubplotZero(fig, 1, 1, 1)
    fig.add_subplot(ax)

    # make right and top axis invisible
    ax.axis["right"].set_visible(False)
    ax.axis["top"].set_visible(False)

    # make xzero axis (horizontal axis line through y=0) visible.
    ax.axis["xzero"].set_visible(False)
    #ax.axis["xzero"].label.set_text("Axis Zero")

    ax.set_xlim(min_time, max_time)
    ax.set_ylim(0, 4)
    ax.set_xlabel("Time")
    ax.set_ylabel("HRV")

    # make new (right-side) yaxis, but wth some offset
    # offset = (20, 0)
    # new_axisline = ax.get_grid_helper().new_fixed_axis

    # ax.axis["right2"] = new_axisline(loc="right",
    #                                  offset=offset,
    #                                  axes=ax)
    # ax.axis["right2"].label.set_text("Label Y2")

    #ax.plot([-2,3,2])
    t_hrv = []
    hrv = []
    for val in l:
        if "hrv" in val.keys():
            t_hrv.append(val["time"])
            hrv.append(val["hrv"])
            #ax.plot(val["time"], val["hrv"], 'b,')
        elif "key" in val.keys():
            ax.plot(val["time"], 2.0, 'r,')
    ax.plot(t_hrv, hrv, 'b-')

    hrv_dict = []
    for el in l:
        try:
            hrv_dict.append((el["time"], el["hrv"]))
        except KeyError:
            pass

    peak_dict = []

    current_peak = 0
    hrv_window = deque()
    hrv_limit = 20
    hrv_total = []
    stop_counter = 0
    hrv_itr = hrv_dict.__iter__()
    b = hrv_itr.next()

    while 1:
        a = [b[0], b[1], 0]
        hrv_window.append(a)
        hrv_total.append(a)
        if len(hrv_window) > hrv_limit:
            hrv_window.popleft()
        max_hrv = 0
        max_time = 0
        for h in hrv_window:
            if h[1] > max_hrv:
                max_time = h[0]
                max_hrv = h[1]
        for h in hrv_window:
            if h[0] == max_time:
                h[2] = h[2] + 1
                break
        try:
            c = hrv_itr.next()
            b = c
        except StopIteration:
            stop_counter = stop_counter + 1
            if stop_counter == hrv_limit:
                break
            
    pulse = 0
    for (time, hrv, score) in hrv_total:
#.........这里部分代码省略.........
开发者ID:qdot,项目名称:pulse-project,代码行数:103,代码来源:graph_example.py


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