Changeset 8295:fee61bea46fc in orange


Ignore:
Timestamp:
06/02/11 18:00:33 (3 years ago)
Author:
Noughmad <Noughmad@…>
Branch:
default
Convert:
2de9c50dc9f217a87891653bca7f9eb0d915980e
Message:

Rename to OWGraphQt, and move ScatterPlotQt to Prototypes

Location:
orange/OrangeWidgets
Files:
3 added
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • orange/OrangeWidgets/Visualize/OWScatterPlot.py

    r8287 r8295  
    1616import OWGUI, OWToolbars, OWColorPalette 
    1717from orngScaleData import * 
     18from OWGraph import OWGraph 
     19 
    1820 
    1921########################################################################################### 
     
    158160        self.graph.discPalette = dlg.getDiscretePalette("discPalette") 
    159161        self.graph.setCanvasBackground(dlg.getColor("Canvas")) 
    160         # self.graph.gridCurve.setPen(QPen(dlg.getColor("Grid"))) 
    161         self.graph.palette.grid_style.color = dlg.getColor("Grid") 
     162        self.graph.gridCurve.setPen(QPen(dlg.getColor("Grid"))) 
    162163 
    163164        self.graph.enableGridXB(self.showGridlines) 
  • orange/OrangeWidgets/Visualize/OWScatterPlotGraph.py

    r8290 r8295  
    22# OWScatterPlotGraph.py 
    33# 
    4 from QtGraph import * 
     4from OWGraph import * 
    55import time 
    66from orngCI import FeatureByCartesianProduct 
     
    5858    def updateData(self, xAttr, yAttr, colorAttr, shapeAttr = "", sizeShapeAttr = "", labelAttr = None, **args): 
    5959#        if not self.haveData: 
    60         self.clear() 
     60#            self.clear() 
    6161#            self.oldLegendKeys = {} 
    6262#            return 
    63         # self.removeDrawingCurves(removeLegendItems = 0)      # my function, that doesn't delete selection curves 
    64         # self.detachItems(QwtPlotItem.Rtti_PlotMarker) 
    65         # self.tips.removeAll() 
     63        self.removeDrawingCurves(removeLegendItems = 0)      # my function, that doesn't delete selection curves 
     64        self.detachItems(QwtPlotItem.Rtti_PlotMarker) 
     65        self.tips.removeAll() 
    6666        self.tooltipData = [] 
    6767        self.potentialsClassifier = None 
    6868        self.potentialsImage = None 
    69         # self.canvas().invalidatePaintCache() 
     69        self.canvas().invalidatePaintCache() 
    7070        self.shownXAttribute = xAttr 
    7171        self.shownYAttribute = yAttr 
    7272 
    7373        if self.scaledData == None or len(self.scaledData) == 0: 
    74            # self.setAxisScale(xBottom, 0, 1, 1); self.setAxisScale(yLeft, 0, 1, 1) 
     74            self.setAxisScale(QwtPlot.xBottom, 0, 1, 1); self.setAxisScale(QwtPlot.yLeft, 0, 1, 1) 
    7575            self.setXaxisTitle(""); self.setYLaxisTitle("") 
    7676            self.oldLegendKeys = {} 
     
    119119            labels = None 
    120120        self.setXlabels(labels) 
    121         self.setAxisScale(xBottom, xmin, xmax, discreteX) 
     121        self.setAxisScale(QwtPlot.xBottom, xmin, xmax + showContinuousColorLegend * xVar * 0.07, discreteX) 
    122122 
    123123        # set axis for y attribute 
     
    134134            labels = None 
    135135        self.setYLlabels(labels) 
    136         self.setAxisScale(yLeft, ymin, ymax, discreteY) 
     136        self.setAxisScale(QwtPlot.yLeft, ymin, ymax, discreteY) 
    137137 
    138138        self.setXaxisTitle(xAttr) 
     
    473473    def computePotentials(self): 
    474474        import orangeom 
    475         rx = self.transform(xBottom, self.xmax) - self.transform(xBottom, self.xmin) 
    476         ry = self.transform(yLeft, self.ymin) - self.transform(yLeft, self.ymax) 
     475        rx = self.transform(QwtPlot.xBottom, self.xmax) - self.transform(QwtPlot.xBottom, self.xmin) 
     476        ry = self.transform(QwtPlot.yLeft, self.ymin) - self.transform(QwtPlot.yLeft, self.ymax) 
    477477        rx -= rx % self.squareGranularity 
    478478        ry -= ry % self.squareGranularity 
    479479 
    480         ox = self.transform(xBottom, 0) - self.transform(xBottom, self.xmin) 
    481         oy = self.transform(yLeft, self.ymin) - self.transform(yLeft, 0) 
     480        ox = self.transform(QwtPlot.xBottom, 0) - self.transform(QwtPlot.xBottom, self.xmin) 
     481        oy = self.transform(QwtPlot.yLeft, self.ymin) - self.transform(QwtPlot.yLeft, 0) 
    482482 
    483483        if not getattr(self, "potentialsImage", None) or getattr(self, "potentialContext", None) != (rx, ry, self.shownXAttribute, self.shownYAttribute, self.squareGranularity, self.jitterSize, self.jitterContinuous, self.spaceBetweenCells): 
     
    508508            if not (self.potentialsClassifier is getattr(self,"potentialsImageFromClassifier", None)): 
    509509                self.computePotentials() 
    510             target = QRectF(self.transform(xBottom, self.xmin), self.transform(yLeft, self.ymax), 
    511                             self.transform(xBottom, self.xmax) - self.transform(xBottom,self.xmin), 
    512                             self.transform(yLeft, self.ymin) - self.transform(yLeft, self.ymax)) 
     510            target = QRectF(self.transform(QwtPlot.xBottom, self.xmin), self.transform(QwtPlot.yLeft, self.ymax), 
     511                            self.transform(QwtPlot.xBottom, self.xmax) - self.transform(QwtPlot.xBottom,self.xmin), 
     512                            self.transform(QwtPlot.yLeft, self.ymin) - self.transform(QwtPlot.yLeft, self.ymax)) 
    513513            source = QRectF(0, 0, self.potentialsImage.size().width(), self.potentialsImage.size().height()) 
    514514            painter.drawImage(target, self.potentialsImage, source) 
    515 #            painter.drawImage(self.transform(xBottom, self.xmin), self.transform(yLeft, self.ymax), self.potentialsImage) 
     515#            painter.drawImage(self.transform(QwtPlot.xBottom, self.xmin), self.transform(QwtPlot.yLeft, self.ymax), self.potentialsImage) 
    516516        OWGraph.drawCanvas(self, painter) 
    517517 
Note: See TracChangeset for help on using the changeset viewer.