From d8b7b6a948ded6a427da22c6d9c2b7ff39127c6e Mon Sep 17 00:00:00 2001 From: Reto Trappitsch Date: Fri, 16 Feb 2024 08:55:50 +0100 Subject: [PATCH 1/2] Improve spacing with low-lying states and transition strength --- src/rimsschemedrawer/gui.py | 2 +- src/rimsschemedrawer/plotter.py | 29 ++++++++++++++++++----------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/src/rimsschemedrawer/gui.py b/src/rimsschemedrawer/gui.py index e97ef96..7793322 100644 --- a/src/rimsschemedrawer/gui.py +++ b/src/rimsschemedrawer/gui.py @@ -30,7 +30,7 @@ class SchemeDrawer(QtWidgets.QMainWindow): def __init__(self): # run in debug mode? - self.rundebug = False + self.rundebug = True # program info self.author = "Reto Trappitsch" diff --git a/src/rimsschemedrawer/plotter.py b/src/rimsschemedrawer/plotter.py index 56b1470..4fc5fe4 100644 --- a/src/rimsschemedrawer/plotter.py +++ b/src/rimsschemedrawer/plotter.py @@ -174,15 +174,6 @@ def _plotit(self): for it in transition_steps: if it < ipvalue: self._axes.hlines(it, xmin=0, xmax=10, color=self.colmain) - # Lines for manifold ground states - for it in range(np.sum(self.config_parser.is_low_lying)): - self._axes.hlines( - mfld_yinc * ipvalue * (1 + it), - xmin=1.5 * it + 2.3, - xmax=1.5 * it + 3.7, - linestyle="solid", - color=self.colmain, - ) # draw the state we come out of, if not ground state if wavenumber_gs > 0.0: @@ -332,6 +323,22 @@ def _plotit(self): yval_bott = transition_steps[it] # now go through low-lying excited states + x_spacing_es = ( + 1.5 + if np.sum(transition_strengths_es) == 0 or not show_trans_strength + else 2.0 + ) + + # Lines for manifold ground states + for it in range(np.sum(self.config_parser.is_low_lying)): + self._axes.hlines( + mfld_yinc * ipvalue * (1 + it), + xmin=x_spacing_es * it + 2.3, + xmax=x_spacing_es * it + 3.7, + linestyle="solid", + color=self.colmain, + ) + for it in range(len(wavenumber_es)): if lambda_step_es[it] >= 700: col = self.colir @@ -342,8 +349,8 @@ def _plotit(self): else: col = self.colfuv - # values - xval = firstarrowxmfl + 1.5 + it * 1.5 + # values for spacing and distance + xval = firstarrowxmfl + x_spacing_es + it * x_spacing_es yval = mfld_yinc * ipvalue * (1 + it) wstp = float(wavenumber_steps[0]) - yval From 579344a95d2560817e1f3874b14e1dffbd15b0c6 Mon Sep 17 00:00:00 2001 From: Reto Trappitsch Date: Fri, 16 Feb 2024 09:28:21 +0100 Subject: [PATCH 2/2] various small changes - change headspace color in dark mode - slightly lighter - fix last transition line just as small line - change default values for headspace, ip position, font size of labels --- requirements-dev.lock | 2 -- requirements.lock | 1 - src/rimsschemedrawer/gui.py | 10 +++++----- src/rimsschemedrawer/plotter.py | 8 ++++---- src/rimsschemedrawer/utils.py | 8 ++++---- 5 files changed, 13 insertions(+), 16 deletions(-) diff --git a/requirements-dev.lock b/requirements-dev.lock index 73ac00a..6ec21b5 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -8,13 +8,11 @@ # with-sources: false -e file:. - # via file:///- attrs==23.2.0 # via hypothesis contourpy==1.2.0 # via matplotlib coverage==7.4.1 - # via coverage # via pytest-cov cycler==0.12.1 # via matplotlib diff --git a/requirements.lock b/requirements.lock index 23f7138..9d34451 100644 --- a/requirements.lock +++ b/requirements.lock @@ -8,7 +8,6 @@ # with-sources: false -e file:. - # via file:///- contourpy==1.2.0 # via matplotlib cycler==0.12.1 diff --git a/src/rimsschemedrawer/gui.py b/src/rimsschemedrawer/gui.py index 7793322..9d4ea8d 100644 --- a/src/rimsschemedrawer/gui.py +++ b/src/rimsschemedrawer/gui.py @@ -30,7 +30,7 @@ class SchemeDrawer(QtWidgets.QMainWindow): def __init__(self): # run in debug mode? - self.rundebug = True + self.rundebug = False # program info self.author = "Reto Trappitsch" @@ -358,10 +358,10 @@ def init_ui(self): "ticks." ) self.edt_sett_headspace.setToolTip( - "Set how much space is added on top of the" - "IP level: the head space. Adjust this" - "value whenever there is not enough space" - "on top to fit all the text in. The value" + "Set how much space is added on top of the " + "IP level: the head space. Adjust this " + "value whenever there is not enough space " + "on top to fit all the text in. The value " "is given in cm-1." ) layout.addWidget(self.edt_sett_arrwidth, 7, 7, 1, 1) diff --git a/src/rimsschemedrawer/plotter.py b/src/rimsschemedrawer/plotter.py index 4fc5fe4..1bb574f 100644 --- a/src/rimsschemedrawer/plotter.py +++ b/src/rimsschemedrawer/plotter.py @@ -42,7 +42,7 @@ def __init__(self, data: dict, **kwargs): self.coluv = "#8c96df" self.colfuv = "#9365b2" self.colpump = "#60a55b" - self.colhdr = "#343f74" # header color + self.colhdr = "#4b5482" # header color else: self.colmain = "#000000" self.colir = "#a00000" @@ -170,8 +170,8 @@ def _plotit(self): size=fsz_labels, ) - # Draw the horizontal lines for every transition below IP and for IP - for it in transition_steps: + # Draw the horizontal lines for every transition except last and for IP + for it in transition_steps[:-1]: if it < ipvalue: self._axes.hlines(it, xmin=0, xmax=10, color=self.colmain) @@ -244,7 +244,7 @@ def _plotit(self): markeredgewidth=5.0, ) - # draw a little dashed line for the last/end state + # draw a little solid line for the last/end state if it == len(lambda_steps) - 1: self._axes.hlines( tstp, diff --git a/src/rimsschemedrawer/utils.py b/src/rimsschemedrawer/utils.py index 47830db..2346155 100644 --- a/src/rimsschemedrawer/utils.py +++ b/src/rimsschemedrawer/utils.py @@ -13,16 +13,16 @@ "fs_title": 14, "fs_axes": 12, "fs_axes_labels": 12, - "fs_labels": 14, - "headspace": 2000, + "fs_labels": 12, + "headspace": 3000, "arrow_width": 0.2, "arrow_head_width": 0.6, "prec_wavelength": 3, "prec_level": 0, "line_breaks": False, - "ip_label_pos": "Top", + "ip_label_pos": "Bottom", "show_forbidden_transitions": "x-out", - "show_transition_strength": False, + "show_transition_strength": True, "show_cm-1_axis": True, "show_eV_axis": True, "plot_darkmode": False,