Changeset 1153 for trunk/python/asaplotbase.py
- Timestamp:
- 08/21/06 10:48:45 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/asaplotbase.py
r1147 r1153 454 454 if what[-6:] == 'colour': what = what[:-6] + 'color' 455 455 456 newargs = {} 457 458 for k, v in kwargs.iteritems(): 459 k = k.lower() 460 if k == 'colour': k = 'color' 461 newargs[k] = v 462 463 getattr(self.axes, "set_%s"%what)(*args, **newargs) 464 465 self.show() 456 key = "colour" 457 if kwargs.has_key(key): 458 val = kwargs.pop(key) 459 kwargs["color"] = val 460 461 getattr(self.axes, "set_%s"%what)(*args, **kwargs) 462 463 self.show(hardrefresh=False) 466 464 467 465 … … 485 483 486 484 getattr(self.figure, "set_%s"%what)(*args, **newargs) 487 self.show( )485 self.show(hardrefresh=False) 488 486 489 487 … … 552 550 self.attributes[k] = v 553 551 554 if redraw: self.show( )552 if redraw: self.show(hardrefresh=False) 555 553 556 554 … … 613 611 for i in range(nplots): 614 612 self.subplots.append({}) 615 self.subplots[i]['axes'] = self.figure.add_subplot(rows, 613 self.subplots[i]['lines'] = [] 614 if not ganged: 615 self.subplots[i]['axes'] = self.figure.add_subplot(rows, 616 616 cols, i+1) 617 self.subplots[i]['lines'] = [] 618 619 if ganged: 617 else: 618 if i == 0: 619 self.subplots[i]['axes'] = self.figure.add_subplot(rows, 620 cols, i+1) 621 else: 622 self.subplots[i]['axes'] = self.figure.add_subplot(rows, 623 cols, i+1, 624 sharex=self.subplots[0]['axes'], 625 sharey=self.subplots[0]['axes']) 620 626 # Suppress tick labelling for interior subplots. 621 627 if i <= (rows-1)*cols - 1: … … 623 629 # Suppress x-labels for frames width 624 630 # adjacent frames 625 self.subplots[i]['axes'].xaxis.set_major_locator(NullLocator()) 631 for tick in self.subplots[i]['axes'].xaxis.majorTicks: 632 tick.label1On = False 626 633 self.subplots[i]['axes'].xaxis.label.set_visible(False) 627 634 if i%cols: … … 631 638 self.subplots[i]['axes'].yaxis.label.set_visible(False) 632 639 # disable the first tick of [1:ncol-1] of the last row 633 if (nplots-cols) < i <= nplots-1:634 self.subplots[i]['axes'].xaxis.set_major_formatter(MyFormatter())640 #if i+1 < nplots: 641 # self.subplots[i]['axes'].xaxis.majorTicks[0].label1On = False 635 642 self.rows = rows 636 643 self.cols = cols 637 644 self.subplot(0) 638 645 646 def tidy(self): 647 # this needs to be exceuted after the first "refresh" 648 nplots = len(self.subplots) 649 if nplots == 1: return 650 for i in xrange(nplots): 651 ax = self.subplots[i]['axes'] 652 if i%self.cols: 653 ax.xaxis.majorTicks[0].label1On = False 654 else: 655 if i != 0: 656 ax.yaxis.majorTicks[-1].label1On = False 657 658 639 659 def set_title(self, title=None): 640 660 """ … … 648 668 649 669 650 def show(self ):670 def show(self, hardrefresh=True): 651 671 """ 652 672 Show graphics dependent on the current buffering state. 653 673 """ 674 if not hardrefresh: return 654 675 if not self.buffering: 655 676 if self.loc is not None:
Note: See TracChangeset
for help on using the changeset viewer.