Fix missing imports needed for drawing the legend

This commit is contained in:
Robin Dunn
2017-09-06 16:54:03 -07:00
parent 03248e0932
commit 81f8c41a24
2 changed files with 9 additions and 2 deletions

View File

@@ -30,7 +30,7 @@ Changes in this release include the following:
* New tool wxget, (a minimal wx implementation of wget)
* New tools wxdocs and wxdemos to launch the respective items fetching and
* New tools wxdocs and wxdemos to launch the respective items, fetching and
unpacking as required. (#437)
* Fixes to ensure that the locale message catalogs are included in the
@@ -70,6 +70,8 @@ Changes in this release include the following:
* Add wx.Simplebook class.
* Fix missing imports needed for drawing the legend in wx.lib.plot. (#503)

View File

@@ -2234,10 +2234,15 @@ class PlotCanvas(wx.Panel):
# 1.1 used as space between lines
lineHeight = max(legendSymExt[1], legendTextExt[1]) * 1.1
dc.SetFont(self._getFont(self._fontSizeLegend))
from .polyobjects import PolyLine
from .polyobjects import PolyMarker
from .polyobjects import PolyBoxPlot
for i in range(len(graphics)):
o = graphics[i]
s = i * lineHeight
if isinstance(o, PolyMarker) or isinstance(o, BoxPlot):
if isinstance(o, PolyMarker) or isinstance(o, PolyBoxPlot):
# draw marker with legend
pnt = (trhc[0] + legendLHS + legendSymExt[0] / 2.,
trhc[1] + s + lineHeight / 2.)