def DrawContourAndMark(contour, x, y, z, level, clipborder, patch, m):
# ??????? ------ ??????????
if contour.contour['visible']:
matplotlib.rcParams['contour.negative_linestyle'] = 'dashed'
if contour.contour['colorline']:
CS1 = m.contour(x, y, z, levels=level,
linewidths=contour.contour['linewidth'])
else:
CS1 = m.contour(x, y, z, levels=level,
linewidths=contour.contour['linewidth'], colors=contour.contour['linecolor'])
# ?????????
if contour.contourlabel['visible']:
CS2 = plt.clabel(CS1, inline=1, fmt=contour.contourlabel['fmt'],
inline_spacing=contour.contourlabel['inlinespacing'],
fontsize=contour.contourlabel['fontsize'],
colors=contour.contourlabel['fontcolor'])
# ???????????
if clipborder.path is not None and clipborder.using:
for collection in CS1.collections:
# collection.set_clip_on(True)
collection.set_clip_path(patch)
for text in CS2:
if not clipborder.path.contains_point(text.get_position()):
text.remove()
# print(CS2)
评论列表
文章目录