def _plot_lff(panel, left_df, right_df, colorMap, y_pos, bar_thickness, text):
""" plots a lff patch
1__________2 ____________
| #lff \ \ #rff \
| left for \3 \ right for \
| forward / / forward /
5___________/4 /___________/
"""
#if there is only one feature to plot, then just plot it
print("plotting lff")
verts = [(left_df['start'], y_pos + bar_thickness), #1
(right_df['start'] - chevron_width, y_pos + bar_thickness), #2
(left_df['stop'], y_pos + (bar_thickness/2)), #3
(right_df['start'] - chevron_width, y_pos), #4
(left_df['start'], y_pos), #5
(left_df['start'], y_pos + bar_thickness), #1
]
codes = [Path.MOVETO,
Path.LINETO,
Path.LINETO,
Path.LINETO,
Path.LINETO,
Path.CLOSEPOLY,
]
path = Path(verts, codes)
patch = patches.PathPatch(path, lw = 0,
fc=colorMap[left_df['featType']] )
text_width = left_df['width']
if text and text_width >= min_text:
panel = _plot_label(panel, left_df, y_pos, bar_thickness)
elif text and text_width < min_text and text_width >= text_cutoff:
panel = _plot_label(panel, left_df,
y_pos, bar_thickness,
rotate = True, arrow = True)
return panel, patch
评论列表
文章目录