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


Python Axes.set_frame_on方法代码示例

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


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

示例1: drawG

# 需要导入模块: from matplotlib.axes import Axes [as 别名]
# 或者: from matplotlib.axes.Axes import set_frame_on [as 别名]
def drawG(fig, n, roundN, graphs):
    graphsId = difGraphsId(graphs)
    size = len(graphsId)
    print 'size ', size
    bgnX = 0.1
    bgnY = 0.1
    width = 0.8 / size
    height = 0.35

    for idx in range(size):
        ax = Axes(fig, [bgnX, bgnY, width * 0.9, height])
        ax.set_xticks(range(-1,3))
        ax.set_yticks(range(-1, n+1))
        ax.set_frame_on(False)

        gid = graphsId[idx]
        ax.set_title( 'Round ' + str(gid+1) )

        for i in range(-1, n + 1):
            ax.plot(0, i, marker = 'o')
            ax.plot(1, i, marker = 'o')

        for edge in graphs[gid]:
            nodes = [int(i) for i in edge.split('-')]
            nodes[1] -= n
            line = Line2D([0, 1], nodes)

            if gid == 0:
                line.set_color('b')
            else:
                color = 'r'
                for e in graphs[gid-1]:
                    if edge == e:
                        color = 'b'
                        break
                line.set_color(color)

            ax.add_line( line )

        preId = max(gid-1, 0)
        for edge in graphs[preId]:
            color = 'g'
            for e in graphs[gid]:
                if edge == e:
                    color = 'b'
                    break

            if color == 'g':
                nodes = [int(i) for i in edge.split('-')]
                nodes[1] -= n
                line = Line2D([0, 1], nodes, linestyle= '--')
                line.set_color(color)
                ax.add_line( line )

        fig.add_axes( ax )
        bgnX += width
开发者ID:iSuneast,项目名称:Market,代码行数:58,代码来源:makeLog.py

示例2: drawEP

# 需要导入模块: from matplotlib.axes import Axes [as 别名]
# 或者: from matplotlib.axes.Axes import set_frame_on [as 别名]
def drawEP(fig, n, roundN, endowments, prices):
    ax = Axes(fig, [.1, .55, .8, .35])
    ax.grid(True)
    ax.set_xticks( range(roundN+1) )
    ax.set_frame_on(False)

    users = [[] for i in range(n)]
    for i in range(n):
        for j in range(roundN):
            users[i].append( float(Fraction(endowments[j][i])) )
        users[i].append( float(Fraction(prices[roundN-1][i])) )

    x = range(roundN+1)
    for i in range(n):
        price = round(float(Fraction(prices[roundN-1][i])), 3)
        ax.plot(x, users[i], linestyle = '--', marker = 'o', label = str(i) + ": " + str(price))
#    ax.legend(bbox_to_anchor=(0., 1.02, 1., .102), loc=2, ncol=min(n, 5), mode="expand", borderaxespad=0.)
    ax.legend()

    fig.add_axes( ax )
开发者ID:iSuneast,项目名称:Market,代码行数:22,代码来源:makeLog.py


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