def CreatePlotList(self): """Make list of elements to plot """ # graph the cell value, frequency pairs for the histogram self.plotlist = [] for r in self.rasterList: if len(self.raster[r]['datalist']) > 0: col = wx.Colour(self.raster[r]['pcolor'][0], self.raster[r]['pcolor'][1], self.raster[r]['pcolor'][2], 255) self.raster[r]['pline'] = plot.PolyLine( self.raster[r]['datalist'], colour=col, width=self.raster[r]['pwidth'], style=self.linestyledict[self.raster[r]['pstyle']], legend=self.raster[r]['plegend']) self.plotlist.append(self.raster[r]['pline']) if len(self.plotlist) > 0: return self.plotlist else: return None
def CreateMinRange(self, bandValues): maxVal = max(bandValues.histo) rMin = bandValues.rangeMin points = [(rMin, 0), (rMin, maxVal)] return plot.PolyLine(points, colour=wx.RED, width=1)
def CreateHistogramLine(self, bandValues): points = [] for cellCat, count in enumerate(bandValues.histo): if cellCat < bandValues.min - 5: continue if cellCat > bandValues.max + 5: break points.append((cellCat, count)) return plot.PolyLine(points, colour=wx.BLACK, width=1)
def DrawCoincidenceLine(self, level, color, bandValues): """Draw line between band min and max values :param level: y coordinate of line :param color: class color :param bandValues: BandStatistics instance """ minim = bandValues.min maxim = bandValues.max points = [(minim, level), (maxim, level)] color = wx.Colour(*map(int, color.split(':'))) return plot.PolyLine(points, colour=color, width=4)
def CreatePlotList(self): """Create a plot data list from transect datalist and transect segment endpoint coordinates. """ # graph the distance, value pairs for the transect self.plotlist = [] # Add segment marker points to plot data list if len(self.seglist) > 0: self.ppoints = plot.PolyMarker( self.seglist, legend=' ' + self.properties['marker']['legend'], colour=wx.Colour( self.properties['marker']['color'][0], self.properties['marker']['color'][1], self.properties['marker']['color'][2], 255), size=self.properties['marker']['size'], fillstyle=self.ptfilldict[ self.properties['marker']['fill']], marker=self.properties['marker']['type']) self.plotlist.append(self.ppoints) # Add profile distance/elevation pairs to plot data list for each # raster profiled for r in self.rasterList: col = wx.Colour(self.raster[r]['pcolor'][0], self.raster[r]['pcolor'][1], self.raster[r]['pcolor'][2], 255) self.raster[r]['pline'] = plot.PolyLine( self.raster[r]['datalist'], colour=col, width=self.raster[r]['pwidth'], style=self.linestyledict[self.raster[r]['pstyle']], legend=self.raster[r]['plegend']) self.plotlist.append(self.raster[r]['pline']) if len(self.plotlist) > 0: return self.plotlist else: return None
def CreateMax(self, bandValues): maxVal = max(bandValues.histo) maxim = bandValues.max points = [(maxim, 0), (maxim, maxVal)] return plot.PolyLine(points, colour=wx.Colour(200, 200, 200), width=1)
def CreateMean(self, bandValues): maxVal = max(bandValues.histo) mean = bandValues.mean points = [(mean, 0), (mean, maxVal)] return plot.PolyLine(points, colour=wx.BLUE, width=1)
def DrawInvisibleLine(self, level): """Draw white line to achieve better margins""" points = [(100, level), (101, level)] return plot.PolyLine(points, colour=wx.WHITE, width=1)