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