Commit 53960fe8 authored by 3Yan's avatar 3Yan
Browse files

Manual annotation - fix5

* printing now does not disconnect annotations from the image
parent 85160f63
...@@ -7,6 +7,7 @@ from PyQt5 import QtGui ...@@ -7,6 +7,7 @@ from PyQt5 import QtGui
from PyQt5 import QtPrintSupport from PyQt5 import QtPrintSupport
from PyQt5 import QtWidgets from PyQt5 import QtWidgets
from pathlib import Path from pathlib import Path
import copy
import prasopes.graphtools as gt import prasopes.graphtools as gt
import prasopes.config as cf import prasopes.config as cf
...@@ -25,13 +26,14 @@ def paint_image(mass_spec, spect, fn=None, painttarget=None): ...@@ -25,13 +26,14 @@ def paint_image(mass_spec, spect, fn=None, painttarget=None):
printplot.set_xlim(spect.get_xlim()) printplot.set_xlim(spect.get_xlim())
printplot.set_ylim(spect.get_ylim()) printplot.set_ylim(spect.get_ylim())
data = [line.get_data() for line in spect.lines] data = [line.get_data() for line in spect.lines]
texts = copy.copy(mass_spec)
if len(mass_spec['headers']) != 0: if len(mass_spec['headers']) != 0:
legend = spect.get_legend().get_texts() legend = spect.get_legend().get_texts()
[gt.pop_plot(*line, printplot, mass_spec, i, legend[i].get_text()) [gt.pop_plot(*line, printplot, texts, i, legend[i].get_text())
for i,line in enumerate(data)] for i,line in enumerate(data)]
printplot.legend(loc=2) printplot.legend(loc=2)
else: else:
[gt.pop_plot(*line, printplot, mass_spec, i) [gt.pop_plot(*line, printplot, texts, i)
for i,line in enumerate(data)] for i,line in enumerate(data)]
printplot.locator_params(nbins=xtics, axis='x') printplot.locator_params(nbins=xtics, axis='x')
if fn not in (None, [None]): if fn not in (None, [None]):
......
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