1#from plotext._utility import bar_marker
2from plotext._utility import no_color, plot_marker
3
4class default_figure_class():
5
6 def __init__(self):
7 self.set_limitsize()
8 self.set_size_term()
9 self.set_size_term_inf()
10 self.interactive = False
11
12 def set_limitsize(self, limit_width = None, limit_height = None):
13 self.limit_width = True if limit_width is None else bool(limit_width)
14 self.limit_height = True if limit_height is None else bool(limit_height)
15 self.limit_size = [self.limit_width, self.limit_height]
16
17 def set_size_term(self, width = None, height = None):
18 self.width_term = 211 * 2 // 3 if width is None else int(width)
19 self.height_term = 53 * 2 // 3 if height is None else int(height)
20 self.size_term = [self.width_term, self.height_term]
21
22 def set_size_term_inf(self, width = None, height = None):
23 m = 5
24 self.width_term_inf = m * self.width_term if width is None else int(width)
25 self.height_term_inf = m * self.height_term if height is None else int(height)
26 self.size_term_inf = [self.width_term, self.height_term]
27
28
29class default_monitor_class():
30
31 def __init__(self):
32 self.marker = plot_marker
33 self.color_init()
34 self.axes_init()
35 self.canvas_init()
36 self.text_init()
37 self.draw_init()
38 self.bar_init()
39 self.confusion_matrix_init()
40
41 def color_init(self): # Default Values for Color Set with Outside Functions
42 self.canvas_color = "white"
43 self.axes_color = "white"
44 self.ticks_color = "black"
45 self.ticks_style = no_color
46
47 def axes_init(self): # Default Values for Variables Set with Outside Functions
48 self.xaxes = [True, True]
49 self.yaxes = [True, True]
50 self.xfrequency = [5, 5] # lower and upper xaxes ticks frequency
51 self.yfrequency = [7, 7] # left and right yaxes ticks frequency
52 self.xdirection = [1, 1] # direction of x axes
53 self.ydirection = [1, 1]
54 self.xticks = [None, None] # xticks coordinates for both axes
55 self.yticks = [None, None]
56
57 def canvas_init(self):
58 self.xscale = ["linear", "log"] # the two possibilities, the first is default
59 self.yscale = ["linear", "log"]
60 self.grid = [False, False]
61
62 def text_init(self):
63 self.alignment = ['left', 'center', 'right', 'top', 'bottom', 'dynamic']
64 self.orientation = ['horizontal', 'vertical'] # the two possible orientations, the first is the default: v = vertical, h = horizontal
65
66 def draw_init(self): # Default Values for Variables Set with Draw internal Arguments
67 self.xside = ["lower", "upper"] # the two possibilities, the first is default
68 self.yside = ["left", "right"] # the two possibilities, the first is default
69 self.lines = False
70 self.fill = False
71 self.fill_internal = "internal"
72 #self.filly = False
73 self.label = None
74
75 def bar_init(self):
76 self.bar_marker = "sd"
77 self.bar_fill = True # bar plot filled or not
78 self.bar_width = 4 / 5 # bar width
79 self.hist_bins = 10
80
81 def confusion_matrix_init(self):
82 self.cmatrix_color = 'orange+'
83 self.cmatrix_style = 'bold'