Commit 4a89b4ce authored by 3Yan's avatar 3Yan
Browse files

Manual annotation - fix

* fixed last commit
parent 53fbd3af
......@@ -104,14 +104,13 @@ def textedit_factory(axis, plot_data):
text=annotation.get_text())
if textdial[1] == True:
annotation.set_text(textdial[0])
if len(textdial[0]) != 0:
annotation.set_bbox(ann_bbox)
if annotation in plot_data['annotation']:
plot_data['annotation'].remove(annotation)
plot_data['texts'].append(annotation)
if len(textdial[0]) == 0 and annotation in plot_data['texts']:
plot_data['texts'].remove(annotation)
axis.figure.canvas.draw()
elif annotation in plot_data['annotation']:
annotation.set_bbox(ann_bbox)
plot_data['annotation'].remove(annotation)
plot_data['texts'].append(annotation)
axis.figure.canvas.draw()
axis.figure.canvas.mpl_connect('pick_event', annpicked)
......@@ -298,7 +297,6 @@ def pop_plot(xdata, ydata, plot, plot_data, colornum=0, legend=None):
plot_data['texts'] = [plot.annotate(
a.get_text(),a.xy, picker=True, bbox=ann_bbox)
for a in oldtexts]
plot_data['texts'] = oldtexts
if "annotation" in plot_data:
ann_spec(plot, 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