From e16ca3384653ed692c048ed0e23ba6f7a8108ddd Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Mon, 30 Sep 2024 18:01:51 -0400 Subject: [PATCH 1/2] Add news and fix warnings --- news/six.rst | 23 ++++++++++++++++++++++ news/warning.rst | 23 ++++++++++++++++++++++ src/diffpy/pdfgui/gui/extendedplotframe.py | 8 ++++---- 3 files changed, 50 insertions(+), 4 deletions(-) create mode 100644 news/six.rst create mode 100644 news/warning.rst diff --git a/news/six.rst b/news/six.rst new file mode 100644 index 00000000..9f5136ce --- /dev/null +++ b/news/six.rst @@ -0,0 +1,23 @@ +**Added:** + +* + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* six dependency in run.txt + +**Fixed:** + +* + +**Security:** + +* diff --git a/news/warning.rst b/news/warning.rst new file mode 100644 index 00000000..06065114 --- /dev/null +++ b/news/warning.rst @@ -0,0 +1,23 @@ +**Added:** + +* + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* two warnings with (1) linestyle redundantly defined and (2) no artists with labels found to put in legend + +**Security:** + +* diff --git a/src/diffpy/pdfgui/gui/extendedplotframe.py b/src/diffpy/pdfgui/gui/extendedplotframe.py index bdc65f23..c28581d4 100644 --- a/src/diffpy/pdfgui/gui/extendedplotframe.py +++ b/src/diffpy/pdfgui/gui/extendedplotframe.py @@ -182,9 +182,10 @@ def insertCurve(self, xData, yData, style): style -- the way curve should be plotted return: internal reference to the newly added curve """ - stylestr, properties = self.__translateStyles(style) - curveRef = self.subplot.plot(xData, yData, stylestr, **properties)[0] - self.subplot.legend(**legendBoxProperties()) + _, properties = self.__translateStyles(style) + curveRef = self.subplot.plot(xData, yData, **properties)[0] + if "legend" in style: + self.subplot.legend(**legendBoxProperties()) try: self.datalims[curveRef] = (min(xData), max(xData), min(yData), max(yData)) except ValueError: @@ -314,7 +315,6 @@ def __translateStyles(self, style): # not 'points', so line properties are required as well lineStyle = lineStyleDict.get(style["line"], "-") # prefer solid lineWidth = style["width"] - stylestr += lineStyle properties.update({"color": color, "linestyle": lineStyle, "linewidth": lineWidth}) if "legend" in style: From b976081654ddd7bbfccc97acdf75e5e5e5d81174 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Mon, 30 Sep 2024 18:04:25 -0400 Subject: [PATCH 2/2] Add back original file content --- src/diffpy/pdfgui/gui/extendedplotframe.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/diffpy/pdfgui/gui/extendedplotframe.py b/src/diffpy/pdfgui/gui/extendedplotframe.py index c28581d4..b9962451 100644 --- a/src/diffpy/pdfgui/gui/extendedplotframe.py +++ b/src/diffpy/pdfgui/gui/extendedplotframe.py @@ -315,6 +315,7 @@ def __translateStyles(self, style): # not 'points', so line properties are required as well lineStyle = lineStyleDict.get(style["line"], "-") # prefer solid lineWidth = style["width"] + stylestr += lineStyle properties.update({"color": color, "linestyle": lineStyle, "linewidth": lineWidth}) if "legend" in style: