本文整理汇总了Python中matplotlib.axes.Axes.set_title方法的典型用法代码示例。如果您正苦于以下问题:Python Axes.set_title方法的具体用法?Python Axes.set_title怎么用?Python Axes.set_title使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类matplotlib.axes.Axes
的用法示例。
在下文中一共展示了Axes.set_title方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: drawG
# 需要导入模块: from matplotlib.axes import Axes [as 别名]
# 或者: from matplotlib.axes.Axes import set_title [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_title
# 需要导入模块: from matplotlib.axes import Axes [as 别名]
# 或者: from matplotlib.axes.Axes import set_title [as 别名]
def set_title(self, label, fontdict=None, **kwargs):
Axes.set_title(self, label, fontdict, **kwargs)
(x, y) = self.title.get_position()
self.title.set_y(0.92 * y)
示例3: apply_plot_config
# 需要导入模块: from matplotlib.axes import Axes [as 别名]
# 或者: from matplotlib.axes.Axes import set_title [as 别名]
def apply_plot_config(cls, ax: axes.Axes, config):
# set label
ax.set_title(config['title'], fontsize=21)
ax.set_xlabel(config['xlabel'])
if isinstance(ax, Axes3D):
ax.set_zlabel(config['ylabel'])
ax.set_ylabel(config['x2label'])
else:
ax.set_ylabel(config['ylabel'])
# set limit
ax.set_xlim(config['xlim'])
if isinstance(ax, Axes3D):
ax.set_zlim(config['ylim'])
ax.set_ylim(config['x2lim'])
else:
ax.set_ylim(config['ylim'])
# set tick
if config['int_xaxis']:
ax.get_xaxis().set_major_locator(plt.MaxNLocator(integer=True))
if config['int_yaxis']:
if isinstance(ax, Axes3D):
ax.get_zaxis().set_major_locator(plt.MaxNLocator(integer=True))
else:
ax.get_yaxis().set_major_locator(plt.MaxNLocator(integer=True))
if config['int_x2axis']:
if isinstance(ax, Axes3D):
ax.get_yaxis().set_major_locator(plt.MaxNLocator(integer=True))
else:
pass
# line style
if config['linestyle'] is not None:
for line in ax.lines:
try:
line.set_linestyle(config['linestyle'])
except:
pass
# marker style
if config['marker'] is not None:
for line in ax.lines:
try:
line.set_marker(config['marker'])
except:
pass
# marker size
if config['markersize'] is not None:
for line in ax.lines:
try:
line.set_markersize(config['markersize'])
except:
pass
for line in ax.collections:
try:
line.set_lw(config['markersize'])
except:
pass
# markert edge
if config['marker_edge_width'] is not None and isinstance(config['marker_edge_width'], (float, int)):
marker_edge_width = config['marker_edge_width']
else:
marker_edge_width = 0.01
for line in ax.lines:
try:
line.set_markeredgewidth(marker_edge_width)
except:
pass
示例4: Figure
# 需要导入模块: from matplotlib.axes import Axes [as 别名]
# 或者: from matplotlib.axes.Axes import set_title [as 别名]
from matplotlib.backends.backend_agg import FigureCanvasAgg
import dna_walk_utils as walk
import random
size_in_inches = [8, 8] #width, height
fig = Figure(figsize=size_in_inches)
ax = Axes(fig, [.1,.1,.8,.8])
fig.add_axes(ax)
bases = walk.TEST_SEQUENCES["Acinetobacter_calcoaceticus"]
bases2 = walk.TEST_SEQUENCES["A.israelii"]
for samplename in walk.TEST_SEQUENCES.keys():
bases = walk.TEST_SEQUENCES[samplename]
print "Walking", samplename
clr = random.choice("bgrcmyk")
def on_window(from_loc, to_loc):
ax.add_line(Line2D([from_loc.x, to_loc.x],[from_loc.y, to_loc.y], color=clr))
walk.do_line_walk(bases, 4, on_window, )
ax.relim()
ax.axis('tight')
ax.set_title('DNA Walk of "All Seqs.fasta"\n(16S Example Set)')
canvas = FigureCanvasAgg(fig)
canvas.print_figure("dna_walk.png")