Changeset 9051:ffa334e0dc73 in orange


Ignore:
Timestamp:
10/04/11 10:59:03 (3 years ago)
Author:
ales_erjavec <ales.erjavec@…>
Branch:
default
Convert:
2a566cc280ae25a3ce3c0e35ce1152cef00bcfd5
Message:

Added some margins to the MDS graph.
References #975.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orange/OrangeWidgets/Unsupervised/OWMDS.py

    r8042 r9051  
    681681                else: 
    682682                    dict[hsv]=[i] 
    683             maxX, maxY = self.mds.points[0] if len(self.mds.points)>0 else (0, 0) 
    684             minX, minY = self.mds.points[0] if len(self.mds.points)>0 else (0, 0) 
     683#            maxX, maxY = self.mds.points[0] if len(self.mds.points)>0 else (0, 0) 
     684#            minX, minY = self.mds.points[0] if len(self.mds.points)>0 else (0, 0) 
    685685            for color in set: 
    686686                #print len(dict[color.getHsv()]), color.name() 
     
    709709                c.setZ(100) 
    710710                if self.NameAttr!=0: 
    711                     c = self.addMarker(self.names[i][self.NameAttr], self.mds.points[i][0], self.mds.points[i][1], Qt.AlignRight) 
     711                    c = self.addMarker(self.names[i][self.NameAttr], self.mds.points[i][0], self.mds.points[i][1], Qt.AlignBottom) 
    712712                    c.setZ(100) 
    713713 
     
    724724            X = [point[0] for point in self.mds.points] 
    725725            Y = [point[1] for point in self.mds.points] 
    726             self.setAxisScale(QwtPlot.xBottom, min(X), max(X)) 
    727             self.setAxisScale(QwtPlot.yLeft, min(Y), max(Y)) 
     726            max_x, min_x = max(X), min(X) 
     727            max_y, min_y = max(Y), min(Y) 
     728            span_x = max_x - min_x 
     729            span_y = max_y - min_y 
     730            self.setAxisScale(QwtPlot.xBottom, min_x - 0.05 * span_x, max_x + 0.05 * span_x) 
     731            self.setAxisScale(QwtPlot.yLeft, min_y - 0.05 * span_y, max_y + 0.05 * span_y) 
    728732             
    729733 
Note: See TracChangeset for help on using the changeset viewer.