figures_tests.py 1.5 KB
Newer Older
1
# IMPORT ---------------------------------------------------------------
2
3
from myplotlib import MplFig
from axes_tests import AxTest
4
5
from axes_tests import AxWithKeywords

6

7
class FigTest(MplFig):                                                  
8
9
10
11
12
  
    FIGSIZE = (8., 6.)
    
    def addAxes(self):
        
13
        self.add_axes(AxTest(self), "p1")
14

15

16
class EmptyFig(MplFig):                                                  
17
18
19
20
21
  
    FIGSIZE = (8., 6.)
    
    def addAxes(self):
        pass
22

23

24
class BrokenFigure(MplFig):
25
26
27
28
29
30

    FIGSIZE = (12., 6.)
    
    def AddAxes(self):
        pass

31

32
class FigTestWithAliases(MplFig):
33
34
35
36
37
38
39
40

    FIGSIZE = (8., 6.)

    def addAxes(self):

        frame1 = [0.1, 0.1, 0.4, 0.8]
        frame2 = [0.6, 0.1, 0.4, 0.8]  
        
41
42
        self.add_axes(AxTest(self, frame=frame1), "p1")
        self.add_axes(AxTest(self, frame=frame2), "p2")
43

Yori Fournier's avatar
Yori Fournier committed
44
    def declare_aliases(self):
45

46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
        self.aliases.update({'x_range': ('p1_x_range', 'p2_x_range'),
                             'y_range': ('p1_y_range', 'p2_y_range')})


class FigTestAxesAliases(MplFig):

    FIGSIZE = (8., 6.)

    def addAxes(self):

        frame1 = [0.1, 0.1, 0.4, 0.8]
        frame2 = [0.6, 0.1, 0.4, 0.8]  
        
        self.add_axes(AxWithKeywords(self, frame=frame1), "p1")
        self.add_axes(AxWithKeywords(self, frame=frame2), "p2")

    def declare_aliases(self):

64
65
        self.aliases.update({'x_range_alias': ('p1_x_range', 'p2_x_range'),
                             'y_range_alias': ('p1_y_range', 'p2_y_range')})