本文整理汇总了Python中matplotlib.axes.Axes.set_yticks方法的典型用法代码示例。如果您正苦于以下问题:Python Axes.set_yticks方法的具体用法?Python Axes.set_yticks怎么用?Python Axes.set_yticks使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类matplotlib.axes.Axes
的用法示例。
在下文中一共展示了Axes.set_yticks方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: drawG
# 需要导入模块: from matplotlib.axes import Axes [as 别名]
# 或者: from matplotlib.axes.Axes import set_yticks [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
示例2: set_rticks
# 需要导入模块: from matplotlib.axes import Axes [as 别名]
# 或者: from matplotlib.axes.Axes import set_yticks [as 别名]
def set_rticks(self, *args, **kwargs):
return Axes.set_yticks(self, *args, **kwargs)