Commit adac2628 authored by 3Yan's avatar 3Yan
Browse files

Manual annotation - fix2

* fixed duplicities when working with multiple lines
parent 15e54c34
...@@ -292,11 +292,12 @@ def pop_plot(xdata, ydata, plot, plot_data, colornum=0, legend=None): ...@@ -292,11 +292,12 @@ def pop_plot(xdata, ydata, plot, plot_data, colornum=0, legend=None):
plot.set_ylim(plot.get_ylim()[1] * -0.01, plot.set_ylim(plot.get_ylim()[1] * -0.01,
plot.get_ylim()[1] * 1.1) plot.get_ylim()[1] * 1.1)
plot.ticklabel_format(scilimits=(0, 0), axis='y') plot.ticklabel_format(scilimits=(0, 0), axis='y')
if "texts" in plot_data: #put hardcoded annotation if there is none
oldtexts = plot_data['texts'] if "texts" in plot_data and not any(
data in plot.get_children() for data in plot_data['texts']):
plot_data['texts'] = [plot.annotate( plot_data['texts'] = [plot.annotate(
a.get_text(),a.xy, picker=True, bbox=ann_bbox) a.get_text(),a.xy, picker=True, bbox=ann_bbox)
for a in oldtexts] for a in plot_data['texts']]
if "annotation" in plot_data: if "annotation" in plot_data:
ann_spec(plot, plot_data) ann_spec(plot, plot_data)
if "xtics" in plot_data: if "xtics" in plot_data:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment