Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions news/six.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* <news item>

**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* six dependency in run.txt

**Fixed:**

* <news item>

**Security:**

* <news item>
23 changes: 23 additions & 0 deletions news/warning.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* <news item>

**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* two warnings with (1) linestyle redundantly defined and (2) no artists with labels found to put in legend

**Security:**

* <news item>
7 changes: 4 additions & 3 deletions src/diffpy/pdfgui/gui/extendedplotframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning 1: UserWarning: linestyle is redundantly defined by the 'linestyle' keyword argument

properties already has linestyle shown below:

           properties.update({"color": color, "linestyle": lineStyle, "linewidth": lineWidth})

if "legend" in style:
self.subplot.legend(**legendBoxProperties())
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning 2: No artists with labels found to put in legend. Note that artists whose label start with an underscore are ignored when legend() is called with no argument.

Solution - just check whether style contains legend like it was checked in line 321 of extendedplotframe.py

        if "legend" in style:
            properties["label"] = style["legend"]
        return stylestr, properties

try:
self.datalims[curveRef] = (min(xData), max(xData), min(yData), max(yData))
except ValueError:
Expand Down