plotext-plus 1.0.9__py3-none-any.whl → 1.0.11__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- plotext_plus/__init__.py +20 -15
- plotext_plus/__main__.py +1 -0
- plotext_plus/_api.py +632 -371
- plotext_plus/_build.py +765 -149
- plotext_plus/_core.py +609 -164
- plotext_plus/_date.py +50 -32
- plotext_plus/_default.py +35 -28
- plotext_plus/_dict.py +807 -103
- plotext_plus/_doc.py +867 -296
- plotext_plus/_doc_utils.py +279 -245
- plotext_plus/_figure.py +1295 -303
- plotext_plus/_global.py +238 -140
- plotext_plus/_matrix.py +217 -63
- plotext_plus/_monitor.py +1036 -489
- plotext_plus/_output.py +29 -23
- plotext_plus/_shtab.py +2 -0
- plotext_plus/_themes.py +363 -247
- plotext_plus/_utility.py +581 -313
- plotext_plus/api.py +418 -332
- plotext_plus/charts.py +47 -24
- plotext_plus/core.py +570 -177
- plotext_plus/mcp_cli.py +15 -13
- plotext_plus/mcp_server.py +813 -332
- plotext_plus/plotext_cli.py +414 -275
- plotext_plus/plotting.py +86 -70
- plotext_plus/themes.py +10 -13
- plotext_plus/utilities.py +33 -33
- plotext_plus/utils.py +240 -140
- {plotext_plus-1.0.9.dist-info → plotext_plus-1.0.11.dist-info}/METADATA +32 -27
- plotext_plus-1.0.11.dist-info/RECORD +33 -0
- {plotext_plus-1.0.9.dist-info → plotext_plus-1.0.11.dist-info}/WHEEL +1 -1
- plotext_plus-1.0.9.dist-info/RECORD +0 -33
- {plotext_plus-1.0.9.dist-info → plotext_plus-1.0.11.dist-info}/entry_points.txt +0 -0
- {plotext_plus-1.0.9.dist-info → plotext_plus-1.0.11.dist-info}/licenses/LICENSE +0 -0
plotext_plus/_build.py
CHANGED
|
@@ -1,24 +1,34 @@
|
|
|
1
1
|
import plotext_plus._utility as ut
|
|
2
|
-
import math
|
|
3
2
|
|
|
4
|
-
# this file builds a class inherited by the
|
|
3
|
+
# this file builds a class inherited by the MonitorClass() in _monitor.py just because its only method - build_plot() - is very long and it is the core of plot building and it is written separately for clarity
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
|
|
6
|
+
class BuildClass:
|
|
7
|
+
|
|
8
|
+
def build_plot(
|
|
9
|
+
self,
|
|
10
|
+
): # it builds the plot given the external settings and internal settings collected in draw()
|
|
9
11
|
|
|
10
12
|
# Initial Tools
|
|
11
13
|
r2 = [0, 1]
|
|
12
|
-
signals = len(self.x)
|
|
13
|
-
|
|
14
|
+
signals = len(self.x)
|
|
15
|
+
signal_indices = list(range(signals))
|
|
16
|
+
texts = len(self.text)
|
|
17
|
+
text_indices = list(range(texts))
|
|
14
18
|
width, height = self.size
|
|
15
19
|
ticks_colors = self.ticks_color, self.ticks_style
|
|
16
20
|
|
|
17
21
|
# Find if Axes are used
|
|
18
|
-
xside = [
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
xside = [
|
|
23
|
+
(self.default.xside[i] in self.xside + self.txside) or self.vcoord[i] != []
|
|
24
|
+
for i in r2
|
|
25
|
+
]
|
|
26
|
+
yside = [
|
|
27
|
+
(self.default.yside[i] in self.yside + self.tyside) or self.hcoord[i] != []
|
|
28
|
+
for i in r2
|
|
29
|
+
]
|
|
30
|
+
|
|
31
|
+
# Remove Useless X and Y Ticks and Labels if axes are not used
|
|
22
32
|
self.xticks = [self.xticks[i] if xside[i] else None for i in r2]
|
|
23
33
|
self.xlabels = [self.xlabels[i] if xside[i] else None for i in r2]
|
|
24
34
|
|
|
@@ -32,66 +42,202 @@ class build_class():
|
|
|
32
42
|
self.vcolors = [self.vcolors[i] if xside[i] else [] for i in r2]
|
|
33
43
|
|
|
34
44
|
# Apply Scale (linear or log) to the data
|
|
35
|
-
xscale = [
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
45
|
+
xscale = [
|
|
46
|
+
ut.get_first(self.xscale, self.xside[s] is self.default.xside[0])
|
|
47
|
+
for s in signal_indices
|
|
48
|
+
] # the x scale for each signal
|
|
49
|
+
yscale = [
|
|
50
|
+
ut.get_first(self.yscale, self.yside[s] is self.default.yside[0])
|
|
51
|
+
for s in signal_indices
|
|
52
|
+
] # the y scale for each signal
|
|
53
|
+
self.x = [
|
|
54
|
+
ut.apply_scale(self.x[s], xscale[s] is self.default.xscale[1])
|
|
55
|
+
for s in signal_indices
|
|
56
|
+
] # apply optional log scale
|
|
57
|
+
self.y = [
|
|
58
|
+
ut.apply_scale(self.y[s], yscale[s] is self.default.yscale[1])
|
|
59
|
+
for s in signal_indices
|
|
60
|
+
]
|
|
39
61
|
|
|
40
62
|
# Apply Scale (linear or log) to the Axes Ticks
|
|
41
|
-
self.xticks = [
|
|
42
|
-
|
|
43
|
-
|
|
63
|
+
self.xticks = [
|
|
64
|
+
(
|
|
65
|
+
ut.apply_scale(self.xticks[i], self.xscale[i] is self.default.xscale[1])
|
|
66
|
+
if self.xticks[i] is not None
|
|
67
|
+
else None
|
|
68
|
+
)
|
|
69
|
+
for i in r2
|
|
70
|
+
] # apply optional log scale
|
|
71
|
+
self.yticks = [
|
|
72
|
+
(
|
|
73
|
+
ut.apply_scale(self.yticks[i], self.yscale[i] is self.default.yscale[1])
|
|
74
|
+
if self.yticks[i] is not None
|
|
75
|
+
else None
|
|
76
|
+
)
|
|
77
|
+
for i in r2
|
|
78
|
+
] # apply optional log scale
|
|
79
|
+
|
|
44
80
|
# Apply Scale (linear or log) to the user defined Lines
|
|
45
|
-
self.hcoord = [
|
|
46
|
-
|
|
81
|
+
self.hcoord = [
|
|
82
|
+
ut.apply_scale(self.hcoord[i], self.yscale[i] is self.default.yscale[1])
|
|
83
|
+
for i in r2
|
|
84
|
+
] # apply optional log scale
|
|
85
|
+
self.vcoord = [
|
|
86
|
+
ut.apply_scale(self.vcoord[i], self.xscale[i] is self.default.xscale[1])
|
|
87
|
+
for i in r2
|
|
88
|
+
] # apply optional log scale
|
|
47
89
|
|
|
48
90
|
# Apply Scale (linear or log) to the user defined Text
|
|
49
|
-
txscale = [
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
91
|
+
txscale = [
|
|
92
|
+
ut.get_first(self.xscale, self.txside[s] is self.default.xside[0])
|
|
93
|
+
for s in text_indices
|
|
94
|
+
] # the x scale for each text
|
|
95
|
+
tyscale = [
|
|
96
|
+
ut.get_first(self.yscale, self.tyside[s] is self.default.yside[0])
|
|
97
|
+
for s in text_indices
|
|
98
|
+
] # the y scale for each text
|
|
99
|
+
self.tx = [
|
|
100
|
+
ut.apply_scale([self.tx[s]], txscale[s] is self.default.xscale[1])[0]
|
|
101
|
+
for s in text_indices
|
|
102
|
+
] # if width_canvas * height_canvas > 0 else [] # apply optional log scale
|
|
103
|
+
self.ty = [
|
|
104
|
+
ut.apply_scale([self.ty[s]], tyscale[s] is self.default.yscale[1])[0]
|
|
105
|
+
for s in text_indices
|
|
106
|
+
] # if width_canvas * height_canvas > 0 else [] # apply optional log scale
|
|
107
|
+
tx = [
|
|
108
|
+
[self.tx[s] for s in text_indices if self.txside[s] is self.default.xside[i]]
|
|
109
|
+
for i in r2
|
|
110
|
+
] # text x coord for each axis
|
|
111
|
+
ty = [
|
|
112
|
+
[self.ty[s] for s in text_indices if self.tyside[s] is self.default.yside[i]]
|
|
113
|
+
for i in r2
|
|
114
|
+
] # text x coofor each axis
|
|
55
115
|
|
|
56
116
|
# Get X Axes Limits
|
|
57
|
-
x = [
|
|
58
|
-
|
|
117
|
+
x = [
|
|
118
|
+
ut.join([self.x[s] for s in signal_indices if self.xside[s] is side])
|
|
119
|
+
for side in self.default.xside
|
|
120
|
+
] # total x data for each axis
|
|
121
|
+
x = [
|
|
122
|
+
x[i] + self.vcoord[i] + tx[i] for i in r2
|
|
123
|
+
] # add v lines and text coords to calculate xlim
|
|
59
124
|
xlim = [ut.get_lim(el) if len(el) > 0 else [None, None] for el in x]
|
|
60
125
|
self.xlim = [ut.replace_none(self.xlim[i], xlim[i]) for i in r2]
|
|
61
|
-
self.xlim = [
|
|
62
|
-
|
|
126
|
+
self.xlim = [
|
|
127
|
+
self.xlim[i][:: self.xdirection[i]] for i in r2
|
|
128
|
+
] # optionally reverse axes
|
|
129
|
+
xlim = [
|
|
130
|
+
self.xlim[0] if self.xside[s] == self.default.xside[0] else self.xlim[1]
|
|
131
|
+
for s in signal_indices
|
|
132
|
+
] # xlim for each signal
|
|
63
133
|
|
|
64
134
|
# Get Y Axes Limits
|
|
65
|
-
y = [
|
|
66
|
-
|
|
135
|
+
y = [
|
|
136
|
+
ut.join([self.y[s] for s in signal_indices if self.yside[s] is side])
|
|
137
|
+
for side in self.default.yside
|
|
138
|
+
]
|
|
139
|
+
y = [
|
|
140
|
+
y[i] + self.hcoord[i] + ty[i] for i in r2
|
|
141
|
+
] # add h lines and text coords to calculate ylim
|
|
67
142
|
ylim = list(map(ut.get_lim, y))
|
|
68
143
|
self.ylim = [ut.replace_none(self.ylim[i], ylim[i]) for i in r2]
|
|
69
|
-
self.ylim = [
|
|
70
|
-
|
|
144
|
+
self.ylim = [
|
|
145
|
+
self.ylim[i][:: self.ydirection[i]] for i in r2
|
|
146
|
+
] # optionally reverse axes
|
|
147
|
+
ylim = [
|
|
148
|
+
self.ylim[0] if self.yside[s] == self.default.yside[0] else self.ylim[1]
|
|
149
|
+
for s in signal_indices
|
|
150
|
+
] # ylim for each signal
|
|
71
151
|
|
|
72
152
|
# Get Y Ticks and Labels
|
|
73
|
-
yticks_to_set = [
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
153
|
+
yticks_to_set = [
|
|
154
|
+
self.yticks[i] is None and yside[i] and len(y[i]) > 0 for i in r2
|
|
155
|
+
]
|
|
156
|
+
yticks = [
|
|
157
|
+
(
|
|
158
|
+
ut.linspace(*self.ylim[i], self.yfrequency[i])
|
|
159
|
+
if yticks_to_set[i]
|
|
160
|
+
else self.yticks[i]
|
|
161
|
+
)
|
|
162
|
+
for i in r2
|
|
163
|
+
] # the actual Y ticks
|
|
164
|
+
yticks_rescaled = [
|
|
165
|
+
ut.reverse_scale(yticks[i], self.yscale[i] is self.default.yscale[1])
|
|
166
|
+
for i in r2
|
|
167
|
+
]
|
|
168
|
+
|
|
169
|
+
ylabels = [
|
|
170
|
+
(
|
|
171
|
+
self.date.times_to_string(yticks_rescaled[i])
|
|
172
|
+
if self.y_date[i]
|
|
173
|
+
else (
|
|
174
|
+
ut.get_labels(yticks_rescaled[i])
|
|
175
|
+
if yticks_to_set[i]
|
|
176
|
+
else self.ylabels[i]
|
|
177
|
+
)
|
|
178
|
+
)
|
|
179
|
+
for i in r2
|
|
180
|
+
]
|
|
181
|
+
ylabels = [
|
|
182
|
+
(
|
|
183
|
+
ut.add_extra_spaces(ylabels[i], self.default.yside[i])
|
|
184
|
+
if ylabels[i] is not None
|
|
185
|
+
else None
|
|
186
|
+
)
|
|
187
|
+
for i in r2
|
|
188
|
+
]
|
|
79
189
|
width_ylabels = [ut.max_length(el) if el is not None else 0 for el in ylabels]
|
|
80
190
|
|
|
81
191
|
# Get X Ticks and Labels
|
|
82
|
-
xticks_to_set = [
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
192
|
+
xticks_to_set = [
|
|
193
|
+
self.xticks[i] is None and xside[i] and len(x[i]) > 0 for i in r2
|
|
194
|
+
]
|
|
195
|
+
xticks = [
|
|
196
|
+
(
|
|
197
|
+
ut.linspace(*self.xlim[i], self.xfrequency[i])
|
|
198
|
+
if xticks_to_set[i]
|
|
199
|
+
else self.xticks[i]
|
|
200
|
+
)
|
|
201
|
+
for i in r2
|
|
202
|
+
] # the actual X ticks
|
|
203
|
+
xticks_rescaled = [
|
|
204
|
+
ut.reverse_scale(xticks[i], self.xscale[i] is self.default.xscale[1])
|
|
205
|
+
for i in r2
|
|
206
|
+
]
|
|
207
|
+
xlabels = [
|
|
208
|
+
(
|
|
209
|
+
self.date.times_to_string(xticks_rescaled[i])
|
|
210
|
+
if self.x_date[i]
|
|
211
|
+
else (
|
|
212
|
+
ut.get_labels(xticks_rescaled[i])
|
|
213
|
+
if xticks_to_set[i]
|
|
214
|
+
else self.xlabels[i]
|
|
215
|
+
)
|
|
216
|
+
)
|
|
217
|
+
for i in r2
|
|
218
|
+
]
|
|
219
|
+
xlabels = [
|
|
220
|
+
(
|
|
221
|
+
ut.add_extra_spaces(xlabels[i], self.default.xside[i])
|
|
222
|
+
if xticks_to_set[i]
|
|
223
|
+
else self.xlabels[i]
|
|
224
|
+
)
|
|
225
|
+
for i in r2
|
|
226
|
+
]
|
|
87
227
|
height_xlabels = [len(el) > 0 if el is not None else 0 for el in xlabels]
|
|
88
228
|
|
|
89
229
|
# Canvas Dimensions (the area of data points)
|
|
90
230
|
width_canvas = width - sum(self.yaxes) - sum(width_ylabels)
|
|
91
|
-
height_highbar = any(
|
|
92
|
-
height_lowbar = any(
|
|
93
|
-
height_canvas =
|
|
94
|
-
|
|
231
|
+
height_highbar = any(el is not None for el in [self.title, self.xlabel[1]])
|
|
232
|
+
height_lowbar = any(el is not None for el in self.ylabel + [self.xlabel[0]])
|
|
233
|
+
height_canvas = (
|
|
234
|
+
height
|
|
235
|
+
- sum(self.xaxes)
|
|
236
|
+
- sum(height_xlabels)
|
|
237
|
+
- height_highbar
|
|
238
|
+
- height_lowbar
|
|
239
|
+
)
|
|
240
|
+
|
|
95
241
|
# Canvas Offset
|
|
96
242
|
col_start = width_ylabels[0] + self.yaxes[0]
|
|
97
243
|
col_end = col_start + width_canvas
|
|
@@ -99,22 +245,76 @@ class build_class():
|
|
|
99
245
|
row_end = row_start + height_canvas
|
|
100
246
|
|
|
101
247
|
# Get Absolute X and Y Ticks
|
|
102
|
-
cticks = [
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
248
|
+
cticks = [
|
|
249
|
+
(
|
|
250
|
+
ut.get_matrix_data(xticks[i], self.xlim[i], width_canvas)
|
|
251
|
+
if xticks[i] is not None
|
|
252
|
+
else []
|
|
253
|
+
)
|
|
254
|
+
for i in r2
|
|
255
|
+
]
|
|
256
|
+
rticks = [
|
|
257
|
+
(
|
|
258
|
+
ut.get_matrix_data(yticks[i], self.ylim[i], height_canvas)
|
|
259
|
+
if yticks[i] is not None
|
|
260
|
+
else []
|
|
261
|
+
)
|
|
262
|
+
for i in r2
|
|
263
|
+
]
|
|
264
|
+
|
|
265
|
+
# Get Absolute Coordinates for user defined Lines
|
|
266
|
+
hticks = [
|
|
267
|
+
(
|
|
268
|
+
ut.get_matrix_data(self.hcoord[i], self.ylim[i], height_canvas)
|
|
269
|
+
if None not in self.ylim[i]
|
|
270
|
+
else []
|
|
271
|
+
)
|
|
272
|
+
for i in r2
|
|
273
|
+
]
|
|
274
|
+
vticks = [
|
|
275
|
+
(
|
|
276
|
+
ut.get_matrix_data(self.vcoord[i], self.xlim[i], width_canvas)
|
|
277
|
+
if None not in self.xlim[i]
|
|
278
|
+
else []
|
|
279
|
+
)
|
|
280
|
+
for i in r2
|
|
281
|
+
]
|
|
108
282
|
|
|
109
283
|
# Get Absolute Coordinates for user defined Text
|
|
110
|
-
txlim = [
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
284
|
+
txlim = [
|
|
285
|
+
ut.get_first(self.xlim, self.txside[s] == self.default.xside[0])
|
|
286
|
+
for s in text_indices
|
|
287
|
+
] # xlim for each text
|
|
288
|
+
tylim = [
|
|
289
|
+
ut.get_first(self.ylim, self.tyside[s] == self.default.yside[0])
|
|
290
|
+
for s in text_indices
|
|
291
|
+
] # xlim for each text
|
|
292
|
+
tcticks = [
|
|
293
|
+
(
|
|
294
|
+
ut.get_matrix_data([self.tx[s]], txlim[s], width_canvas)[0]
|
|
295
|
+
if width_canvas > 0
|
|
296
|
+
else 0
|
|
297
|
+
)
|
|
298
|
+
for s in text_indices
|
|
299
|
+
] # if width_canvas > 0 else [] #
|
|
300
|
+
trticks = [
|
|
301
|
+
(
|
|
302
|
+
ut.get_matrix_data([self.ty[s]], tylim[s], height_canvas)[0]
|
|
303
|
+
if height_canvas > 0
|
|
304
|
+
else 0
|
|
305
|
+
)
|
|
306
|
+
for s in text_indices
|
|
307
|
+
] # if height_canvas > 0 else [] #
|
|
114
308
|
|
|
115
309
|
# Get effective number of User Lines
|
|
116
|
-
hlines = [len(el) for el in hticks]
|
|
117
|
-
|
|
310
|
+
hlines = [len(el) for el in hticks]
|
|
311
|
+
hline_indices = [
|
|
312
|
+
list(range(el)) for el in hlines
|
|
313
|
+
] # number of user defined horizontal lines for each y axis (as list)
|
|
314
|
+
vlines = [len(el) for el in vticks]
|
|
315
|
+
vline_indices = [
|
|
316
|
+
list(range(el)) for el in vlines
|
|
317
|
+
] # number of user defined vertical lines for each x axis (as list)
|
|
118
318
|
|
|
119
319
|
# Create Matrix of Markers
|
|
120
320
|
self.matrix.set_size(width, height)
|
|
@@ -124,147 +324,563 @@ class build_class():
|
|
|
124
324
|
self.matrix.set_matrices()
|
|
125
325
|
|
|
126
326
|
# Add Title
|
|
127
|
-
col_center =
|
|
327
|
+
col_center = (
|
|
328
|
+
col_start + width_canvas // 2
|
|
329
|
+
) # centered on the canvas not the entire plot
|
|
128
330
|
col_title = col_center if self.xlabel[1] is None else 0
|
|
129
331
|
row_title = row_end + self.xaxes[1] + height_xlabels[1]
|
|
130
332
|
alignment_title = "center" if self.xlabel[1] is None else "left"
|
|
131
|
-
|
|
333
|
+
(
|
|
334
|
+
self.matrix.add_horizontal_string(
|
|
335
|
+
col_title,
|
|
336
|
+
row_title,
|
|
337
|
+
self.title,
|
|
338
|
+
*ticks_colors,
|
|
339
|
+
alignment=alignment_title,
|
|
340
|
+
check_space=True,
|
|
341
|
+
)
|
|
342
|
+
if self.title and height > 0
|
|
343
|
+
else None
|
|
344
|
+
)
|
|
132
345
|
|
|
133
346
|
# Add Upper X Label
|
|
134
|
-
|
|
347
|
+
(
|
|
348
|
+
self.matrix.add_horizontal_string(
|
|
349
|
+
col_center,
|
|
350
|
+
row_title,
|
|
351
|
+
self.xlabel[1],
|
|
352
|
+
*ticks_colors,
|
|
353
|
+
alignment="center",
|
|
354
|
+
check_space=True,
|
|
355
|
+
)
|
|
356
|
+
if self.xlabel[1] and height > 0
|
|
357
|
+
else None
|
|
358
|
+
)
|
|
135
359
|
|
|
136
360
|
# Add Lower X Ticks
|
|
137
361
|
row_xticks = min(row_start - self.xaxes[0] - 1, height - 1)
|
|
138
|
-
cticks_inserted = [
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
362
|
+
cticks_inserted = [
|
|
363
|
+
height > 0
|
|
364
|
+
and self.matrix.add_horizontal_string(
|
|
365
|
+
col_start + cticks[0][i],
|
|
366
|
+
row_xticks,
|
|
367
|
+
xlabels[0][i],
|
|
368
|
+
*ticks_colors,
|
|
369
|
+
alignment="dynamic",
|
|
370
|
+
check_space=True,
|
|
371
|
+
)
|
|
372
|
+
for i in range(len(cticks[0]))
|
|
373
|
+
]
|
|
374
|
+
cticks[0] = [
|
|
375
|
+
cticks[0][i] for i in range(len(cticks[0])) if cticks_inserted[i]
|
|
376
|
+
] # it updates the x ticks coordinates whatever x labels were inserted
|
|
377
|
+
|
|
378
|
+
# Add Upper X Ticks: the reason to do it here prematurely, is that the cticks[1] need to be re-evaluated for next step
|
|
142
379
|
row_xticks = row_end + self.xaxes[1]
|
|
143
|
-
cticks_inserted = [
|
|
144
|
-
|
|
380
|
+
cticks_inserted = [
|
|
381
|
+
height > 0
|
|
382
|
+
and self.matrix.add_horizontal_string(
|
|
383
|
+
col_start + cticks[1][i],
|
|
384
|
+
row_xticks,
|
|
385
|
+
xlabels[1][i],
|
|
386
|
+
*ticks_colors,
|
|
387
|
+
alignment="dynamic",
|
|
388
|
+
check_space=True,
|
|
389
|
+
)
|
|
390
|
+
for i in range(len(cticks[1]))
|
|
391
|
+
]
|
|
392
|
+
cticks[1] = [
|
|
393
|
+
cticks[1][i] for i in range(len(cticks[1])) if cticks_inserted[i]
|
|
394
|
+
] # it updates the x ticks coordinates whatever x labels were inserted
|
|
145
395
|
|
|
146
396
|
# Add Upper X Axes (from previous step)
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
397
|
+
def get_upper_x_tick(i):
|
|
398
|
+
if self.grid[1] and i in cticks[1]:
|
|
399
|
+
return "┼"
|
|
400
|
+
elif self.grid[1] and i in cticks[0] or i in ut.join(vticks):
|
|
401
|
+
return "┬"
|
|
402
|
+
elif i in cticks[1]:
|
|
403
|
+
return "┴"
|
|
404
|
+
else:
|
|
405
|
+
return "─"
|
|
406
|
+
|
|
407
|
+
xaxis = [get_upper_x_tick(i) for i in range(width_canvas)]
|
|
408
|
+
(
|
|
409
|
+
self.matrix.add_horizontal_string(
|
|
410
|
+
col_start, row_end, xaxis, self.ticks_color
|
|
411
|
+
)
|
|
412
|
+
if self.xaxes[0] and height_canvas >= -1
|
|
413
|
+
else None
|
|
414
|
+
)
|
|
150
415
|
|
|
151
416
|
# Add Left Y Ticks
|
|
152
|
-
|
|
153
|
-
|
|
417
|
+
(
|
|
418
|
+
[
|
|
419
|
+
self.matrix.add_horizontal_string(
|
|
420
|
+
0, rticks[0][i] + row_start, ylabels[0][i], *ticks_colors
|
|
421
|
+
)
|
|
422
|
+
for i in range(len(rticks[0]))
|
|
423
|
+
]
|
|
424
|
+
if width >= width_ylabels[0]
|
|
425
|
+
else None
|
|
426
|
+
)
|
|
427
|
+
|
|
154
428
|
# Add Left Y Axis
|
|
155
|
-
|
|
156
|
-
|
|
429
|
+
def get_left_y_tick(i):
|
|
430
|
+
if self.grid[0] and i in rticks[0]:
|
|
431
|
+
return "┼"
|
|
432
|
+
elif self.grid[0] and i in rticks[1] or i in ut.join(hticks):
|
|
433
|
+
return "├"
|
|
434
|
+
elif i in rticks[0]:
|
|
435
|
+
return "┤"
|
|
436
|
+
else:
|
|
437
|
+
return "│"
|
|
438
|
+
|
|
439
|
+
yaxis = [get_left_y_tick(i) for i in range(height_canvas)]
|
|
157
440
|
col_yaxis = width_ylabels[0]
|
|
158
|
-
|
|
441
|
+
(
|
|
442
|
+
self.matrix.add_vertical_string(
|
|
443
|
+
col_yaxis, row_start, yaxis, self.ticks_color
|
|
444
|
+
)
|
|
445
|
+
if self.yaxes[0] and width >= sum(width_ylabels) + 1
|
|
446
|
+
else None
|
|
447
|
+
)
|
|
159
448
|
|
|
160
449
|
# Add Right Y Axis
|
|
161
|
-
tick
|
|
450
|
+
def tick(i):
|
|
451
|
+
return (
|
|
452
|
+
"┼"
|
|
453
|
+
if (self.grid[0] and i in rticks[1])
|
|
454
|
+
else (
|
|
455
|
+
"┤"
|
|
456
|
+
if (self.grid[0] and i in rticks[0] or i in ut.join(hticks))
|
|
457
|
+
else "├" if i in rticks[1] else "│"
|
|
458
|
+
)
|
|
459
|
+
)
|
|
162
460
|
yaxis = [tick(i) for i in range(height_canvas)]
|
|
163
|
-
|
|
461
|
+
(
|
|
462
|
+
self.matrix.add_vertical_string(col_end, row_start, yaxis, self.ticks_color)
|
|
463
|
+
if self.yaxes[1] and width >= sum(width_ylabels) + self.yaxes[0] + 1
|
|
464
|
+
else None
|
|
465
|
+
)
|
|
164
466
|
|
|
165
467
|
# Add Right Y Ticks
|
|
166
|
-
|
|
468
|
+
(
|
|
469
|
+
[
|
|
470
|
+
self.matrix.add_horizontal_string(
|
|
471
|
+
col_end + 1, rticks[1][i] + row_start, ylabels[1][i], *ticks_colors
|
|
472
|
+
)
|
|
473
|
+
for i in range(len(rticks[1]))
|
|
474
|
+
]
|
|
475
|
+
if width >= sum(width_ylabels) + 1
|
|
476
|
+
else None
|
|
477
|
+
)
|
|
167
478
|
|
|
168
479
|
# Add Frame 4 Corners if necessary
|
|
169
480
|
canvas_test = height_canvas >= 0 and width_canvas >= 0
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
481
|
+
(
|
|
482
|
+
self.matrix.insert_element(
|
|
483
|
+
col_start - 1, row_start - 1, "└", self.ticks_color
|
|
484
|
+
)
|
|
485
|
+
if self.xaxes[0] and self.yaxes[0] and canvas_test
|
|
486
|
+
else None
|
|
487
|
+
)
|
|
488
|
+
(
|
|
489
|
+
self.matrix.insert_element(col_end, row_start - 1, "┘", self.ticks_color)
|
|
490
|
+
if self.xaxes[0] and self.yaxes[1] and canvas_test
|
|
491
|
+
else None
|
|
492
|
+
)
|
|
493
|
+
(
|
|
494
|
+
self.matrix.insert_element(col_start - 1, row_end, "┌", self.ticks_color)
|
|
495
|
+
if self.xaxes[1] and self.yaxes[0] and canvas_test
|
|
496
|
+
else None
|
|
497
|
+
)
|
|
498
|
+
(
|
|
499
|
+
self.matrix.insert_element(col_end, row_end, "┐", self.ticks_color)
|
|
500
|
+
if self.xaxes[1] and self.yaxes[1] and canvas_test
|
|
501
|
+
else None
|
|
502
|
+
)
|
|
174
503
|
|
|
175
504
|
# Add Lower X Axes (from previous step)
|
|
176
|
-
tick
|
|
505
|
+
def tick(i):
|
|
506
|
+
return (
|
|
507
|
+
"┼"
|
|
508
|
+
if (self.grid[1] and i in cticks[0])
|
|
509
|
+
else (
|
|
510
|
+
"┴"
|
|
511
|
+
if (self.grid[1] and i in cticks[1] or i in ut.join(vticks))
|
|
512
|
+
else "┬" if i in cticks[0] else "─"
|
|
513
|
+
)
|
|
514
|
+
)
|
|
177
515
|
xaxis = [tick(i) for i in range(width_canvas)]
|
|
178
|
-
|
|
516
|
+
(
|
|
517
|
+
self.matrix.add_horizontal_string(
|
|
518
|
+
col_start, row_start - 1, xaxis, self.ticks_color
|
|
519
|
+
)
|
|
520
|
+
if self.xaxes[0] and height_canvas >= -1
|
|
521
|
+
else None
|
|
522
|
+
)
|
|
179
523
|
|
|
180
524
|
# Add Left Y Label
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
525
|
+
(
|
|
526
|
+
self.matrix.add_horizontal_string(
|
|
527
|
+
0, 0, self.ylabel[0], *ticks_colors, check_space=True
|
|
528
|
+
)
|
|
529
|
+
if self.ylabel[0] and height > 0
|
|
530
|
+
else None
|
|
531
|
+
)
|
|
532
|
+
|
|
533
|
+
# Add Right Y Label
|
|
534
|
+
(
|
|
535
|
+
self.matrix.add_horizontal_string(
|
|
536
|
+
width - 1,
|
|
537
|
+
0,
|
|
538
|
+
self.ylabel[1],
|
|
539
|
+
*ticks_colors,
|
|
540
|
+
check_space=True,
|
|
541
|
+
alignment="right",
|
|
542
|
+
)
|
|
543
|
+
if self.ylabel[1] and height > 0
|
|
544
|
+
else None
|
|
545
|
+
)
|
|
546
|
+
|
|
547
|
+
# Add Lower X Label
|
|
548
|
+
(
|
|
549
|
+
self.matrix.add_horizontal_string(
|
|
550
|
+
col_center,
|
|
551
|
+
0,
|
|
552
|
+
self.xlabel[0],
|
|
553
|
+
*ticks_colors,
|
|
554
|
+
alignment="center",
|
|
555
|
+
check_space=True,
|
|
556
|
+
)
|
|
557
|
+
if self.xlabel[0] and height > 0
|
|
558
|
+
else None
|
|
559
|
+
)
|
|
188
560
|
|
|
189
561
|
# Add Grid Lines
|
|
190
|
-
hline =
|
|
191
|
-
[
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
562
|
+
hline = "─" * width_canvas
|
|
563
|
+
[
|
|
564
|
+
self.matrix.add_horizontal_string(
|
|
565
|
+
0 + col_start, row + row_start, hline, self.ticks_color
|
|
566
|
+
)
|
|
567
|
+
for row in ut.join(rticks)
|
|
568
|
+
if self.grid[0]
|
|
569
|
+
]
|
|
570
|
+
vline = "│" * height_canvas
|
|
571
|
+
[
|
|
572
|
+
self.matrix.add_vertical_string(
|
|
573
|
+
col + col_start, 0 + row_start, vline, self.ticks_color
|
|
574
|
+
)
|
|
575
|
+
for col in ut.join(cticks)
|
|
576
|
+
if self.grid[1]
|
|
577
|
+
]
|
|
578
|
+
[
|
|
579
|
+
self.matrix.insert_element(col + col_start, row + row_start, "┼")
|
|
580
|
+
for row in ut.join(rticks)
|
|
581
|
+
for col in ut.join(cticks)
|
|
582
|
+
if all(self.grid)
|
|
583
|
+
] # deals with the crossing between grids
|
|
584
|
+
|
|
196
585
|
# Add user defined Lines
|
|
197
|
-
[
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
586
|
+
[
|
|
587
|
+
[
|
|
588
|
+
self.matrix.add_horizontal_string(
|
|
589
|
+
col_start, hticks[i][line_idx] + row_start, hline, self.hcolors[i][line_idx]
|
|
590
|
+
)
|
|
591
|
+
for line_idx in hline_indices[i]
|
|
592
|
+
]
|
|
593
|
+
for i in r2
|
|
594
|
+
]
|
|
595
|
+
[
|
|
596
|
+
[
|
|
597
|
+
self.matrix.add_vertical_string(
|
|
598
|
+
vticks[i][line_idx] + col_start, 0 + row_start, vline, self.vcolors[i][line_idx]
|
|
599
|
+
)
|
|
600
|
+
for line_idx in vline_indices[i]
|
|
601
|
+
]
|
|
602
|
+
for i in r2
|
|
603
|
+
]
|
|
604
|
+
[
|
|
605
|
+
[
|
|
606
|
+
[
|
|
607
|
+
self.matrix.insert_element(
|
|
608
|
+
col + col_start,
|
|
609
|
+
hticks[i][line_idx] + row_start,
|
|
610
|
+
"┼",
|
|
611
|
+
self.hcolors[i][line_idx],
|
|
612
|
+
)
|
|
613
|
+
for line_idx in hline_indices[i]
|
|
614
|
+
]
|
|
615
|
+
for i in r2
|
|
616
|
+
]
|
|
617
|
+
for col in ut.join(cticks)
|
|
618
|
+
if self.grid[1]
|
|
619
|
+
] # deals with the crossing between h lines and v grids
|
|
620
|
+
[
|
|
621
|
+
[
|
|
622
|
+
[
|
|
623
|
+
self.matrix.insert_element(
|
|
624
|
+
vticks[i][line_idx] + col_start,
|
|
625
|
+
row + row_start,
|
|
626
|
+
"┼",
|
|
627
|
+
self.vcolors[i][line_idx],
|
|
628
|
+
)
|
|
629
|
+
for line_idx in vline_indices[i]
|
|
630
|
+
]
|
|
631
|
+
for i in r2
|
|
632
|
+
]
|
|
633
|
+
for row in ut.join(rticks)
|
|
634
|
+
if self.grid[0]
|
|
635
|
+
] # deals with the crossing between v lines and h grids
|
|
636
|
+
[
|
|
637
|
+
[
|
|
638
|
+
[
|
|
639
|
+
[
|
|
640
|
+
self.matrix.insert_element(
|
|
641
|
+
col_start + vticks[iv][lv],
|
|
642
|
+
hticks[i][line_idx] + row_start,
|
|
643
|
+
"┼",
|
|
644
|
+
self.hcolors[i][line_idx],
|
|
645
|
+
)
|
|
646
|
+
for line_idx in hline_indices[i]
|
|
647
|
+
]
|
|
648
|
+
for i in r2
|
|
649
|
+
]
|
|
650
|
+
for lv in vline_indices[iv]
|
|
651
|
+
]
|
|
652
|
+
for iv in r2
|
|
653
|
+
] # deals with the crossing between h and v lines
|
|
202
654
|
|
|
203
655
|
# Expand Canvas to accommodate HD markers
|
|
204
|
-
xf = [
|
|
205
|
-
|
|
656
|
+
xf = [
|
|
657
|
+
max([ut.marker_factor(el, 2, 2, 2) for el in self.marker[s]], default=1)
|
|
658
|
+
for s in signal_indices
|
|
659
|
+
]
|
|
660
|
+
yf = [
|
|
661
|
+
max([ut.marker_factor(el, 2, 3, 4) for el in self.marker[s]], default=1)
|
|
662
|
+
for s in signal_indices
|
|
663
|
+
]
|
|
206
664
|
width_expanded = [width_canvas * el for el in xf]
|
|
207
665
|
height_expanded = [height_canvas * el for el in yf]
|
|
208
666
|
|
|
209
667
|
# Get Relative Data to Be Plotted on Matrix
|
|
210
|
-
test_canvas = [width_expanded[s] * width_expanded[s] for s in
|
|
211
|
-
x = [
|
|
212
|
-
|
|
668
|
+
test_canvas = [width_expanded[s] * width_expanded[s] for s in signal_indices]
|
|
669
|
+
x = [
|
|
670
|
+
(
|
|
671
|
+
ut.get_matrix_data(self.x[s], xlim[s], width_expanded[s])
|
|
672
|
+
if test_canvas[s]
|
|
673
|
+
else []
|
|
674
|
+
)
|
|
675
|
+
for s in signal_indices
|
|
676
|
+
]
|
|
677
|
+
y = [
|
|
678
|
+
(
|
|
679
|
+
ut.get_matrix_data(self.y[s], ylim[s], height_expanded[s])
|
|
680
|
+
if test_canvas[s]
|
|
681
|
+
else []
|
|
682
|
+
)
|
|
683
|
+
for s in signal_indices
|
|
684
|
+
]
|
|
213
685
|
m, c, st = self.marker, self.color, self.style
|
|
214
686
|
|
|
215
|
-
|
|
216
687
|
# Add Lines between Data Points
|
|
217
|
-
x, y, m, c, st = ut.transpose(
|
|
688
|
+
x, y, m, c, st = ut.transpose(
|
|
689
|
+
[
|
|
690
|
+
(
|
|
691
|
+
ut.get_lines(x[s], y[s], m[s], c[s], st[s])
|
|
692
|
+
if self.lines[s]
|
|
693
|
+
else (x[s], y[s], m[s], c[s], st[s])
|
|
694
|
+
)
|
|
695
|
+
for s in signal_indices
|
|
696
|
+
],
|
|
697
|
+
5,
|
|
698
|
+
)
|
|
218
699
|
|
|
219
700
|
# Fillx
|
|
220
|
-
#x, y, m, c, st = ut.transpose([ut.brush(x[s], y[s], m[s], c[s], st[s]) for s in
|
|
221
|
-
level = [
|
|
222
|
-
|
|
223
|
-
|
|
701
|
+
# x, y, m, c, st = ut.transpose([ut.brush(x[s], y[s], m[s], c[s], st[s]) for s in signal_indices], 5)
|
|
702
|
+
level = [
|
|
703
|
+
ut.get_fill_level(self.fillx[s], ylim[s], height_expanded[s])
|
|
704
|
+
for s in signal_indices
|
|
705
|
+
]
|
|
706
|
+
x, y, m, c, st = ut.transpose(
|
|
707
|
+
[
|
|
708
|
+
(
|
|
709
|
+
ut.fill_data(x[s], y[s], level[s], m[s], c[s], st[s])
|
|
710
|
+
if self.fillx[s] is not False
|
|
711
|
+
else (x[s], y[s], m[s], c[s], st[s])
|
|
712
|
+
)
|
|
713
|
+
for s in signal_indices
|
|
714
|
+
],
|
|
715
|
+
5,
|
|
716
|
+
)
|
|
717
|
+
|
|
224
718
|
# Filly
|
|
225
|
-
#x, y, m, c, st = ut.transpose([ut.brush(x[s], y[s], m[s], c[s], st[s]) for s in
|
|
226
|
-
level = [
|
|
227
|
-
|
|
719
|
+
# x, y, m, c, st = ut.transpose([ut.brush(x[s], y[s], m[s], c[s], st[s]) for s in signal_indices], 5)
|
|
720
|
+
level = [
|
|
721
|
+
ut.get_fill_level(self.filly[s], xlim[s], width_expanded[s])
|
|
722
|
+
for s in signal_indices
|
|
723
|
+
]
|
|
724
|
+
y, x, m, c, st = ut.transpose(
|
|
725
|
+
[
|
|
726
|
+
(
|
|
727
|
+
ut.fill_data(y[s], x[s], level[s], m[s], c[s], st[s])
|
|
728
|
+
if self.filly[s] is not False
|
|
729
|
+
else (y[s], x[s], m[s], c[s], st[s])
|
|
730
|
+
)
|
|
731
|
+
for s in signal_indices
|
|
732
|
+
],
|
|
733
|
+
5,
|
|
734
|
+
)
|
|
228
735
|
|
|
229
736
|
# Get Actual HD Markers
|
|
230
|
-
x, y, m, c, st = ut.transpose(
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
737
|
+
x, y, m, c, st = ut.transpose(
|
|
738
|
+
[ut.brush(x[s], y[s], m[s], c[s], st[s]) for s in signal_indices], 5
|
|
739
|
+
)
|
|
740
|
+
xf = [[ut.marker_factor(el, 2, 2, 2) for el in m[s]] for s in signal_indices]
|
|
741
|
+
yf = [[ut.marker_factor(el, 2, 3, 4) for el in m[s]] for s in signal_indices]
|
|
742
|
+
test = [max(xf[s], default=1) * max(yf[s], default=1) != 1 for s in signal_indices]
|
|
743
|
+
x, y, mxy = ut.transpose(
|
|
744
|
+
[
|
|
745
|
+
ut.hd_group(x[s], y[s], xf[s], yf[s]) if test[s] else (x[s], y[s], [])
|
|
746
|
+
for s in signal_indices
|
|
747
|
+
],
|
|
748
|
+
3,
|
|
749
|
+
)
|
|
750
|
+
m = [
|
|
751
|
+
[
|
|
752
|
+
ut.get_hd_marker(mxy[s][i]) if m[s][i] in ut.hd_symbols else m[s][i]
|
|
753
|
+
for i in range(len(x[s]))
|
|
754
|
+
]
|
|
755
|
+
for s in signal_indices
|
|
756
|
+
]
|
|
236
757
|
|
|
237
758
|
# Add Data to Canvas
|
|
238
|
-
x, y, m, c, st = ut.transpose(
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
759
|
+
x, y, m, c, st = ut.transpose(
|
|
760
|
+
[
|
|
761
|
+
ut.remove_outsiders(
|
|
762
|
+
x[s], y[s], width_canvas, height_canvas, m[s], c[s], st[s]
|
|
763
|
+
)
|
|
764
|
+
for s in signal_indices
|
|
765
|
+
],
|
|
766
|
+
5,
|
|
767
|
+
)
|
|
768
|
+
|
|
769
|
+
x, y, m, c, st = ut.transpose(
|
|
770
|
+
[ut.brush(x[s], y[s], m[s], c[s], st[s]) for s in signal_indices], 5
|
|
771
|
+
)
|
|
772
|
+
[
|
|
773
|
+
[
|
|
774
|
+
self.matrix.insert_element(
|
|
775
|
+
x[s][i] + col_start, y[s][i] + row_start, m[s][i], c[s][i], st[s][i]
|
|
776
|
+
)
|
|
777
|
+
for i in range(len(x[s]))
|
|
778
|
+
]
|
|
779
|
+
for s in signal_indices
|
|
780
|
+
]
|
|
242
781
|
|
|
243
782
|
# Legend Utilities
|
|
244
|
-
labelled
|
|
245
|
-
|
|
246
|
-
labels = [
|
|
783
|
+
def labelled(s):
|
|
784
|
+
return self.label[s] is not None
|
|
785
|
+
labels = [ut.space + self.label[s] + ut.space for s in signal_indices if labelled(s)]
|
|
786
|
+
label_count = len(labels)
|
|
787
|
+
max_label_length = ut.max_length(labels)
|
|
788
|
+
labels = [el + ut.space * (max_label_length - len(el)) for el in labels]
|
|
247
789
|
|
|
248
790
|
# Add Legend Side Symbols
|
|
249
|
-
side = [
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
791
|
+
side = [
|
|
792
|
+
ut.space + ut.side_symbols[(self.xside[s], self.yside[s])]
|
|
793
|
+
for s in signal_indices
|
|
794
|
+
if labelled(s)
|
|
795
|
+
]
|
|
796
|
+
side_test = ut.no_duplicates(side) != [" L"] and label_count != 1
|
|
797
|
+
side_width = 2 if side_test else 0
|
|
798
|
+
legend_test = width_canvas >= side_width + 3 + max_label_length and height_canvas >= len(labels)
|
|
799
|
+
(
|
|
800
|
+
[
|
|
801
|
+
self.matrix.add_horizontal_string(
|
|
802
|
+
col_start,
|
|
803
|
+
row_end - 1 - s,
|
|
804
|
+
side[s],
|
|
805
|
+
self.ticks_color,
|
|
806
|
+
self.ticks_style,
|
|
807
|
+
)
|
|
808
|
+
for s in range(label_count)
|
|
809
|
+
]
|
|
810
|
+
if legend_test and side_test
|
|
811
|
+
else None
|
|
812
|
+
)
|
|
253
813
|
|
|
254
814
|
# Add Legend Markers
|
|
255
|
-
take_3
|
|
256
|
-
|
|
257
|
-
|
|
815
|
+
def take_3(data):
|
|
816
|
+
return (data[:3] * 3)[:3]
|
|
817
|
+
marker = [take_3(self.marker[s]) for s in signal_indices if labelled(s)]
|
|
818
|
+
def replace_hd_marker(marker):
|
|
819
|
+
return (
|
|
820
|
+
ut.hd_symbols.get(marker, marker)
|
|
821
|
+
)
|
|
258
822
|
marker = [[ut.space] + list(map(replace_hd_marker, el)) for el in marker]
|
|
259
|
-
color =
|
|
260
|
-
style =
|
|
261
|
-
|
|
262
|
-
|
|
823
|
+
color = [[ut.no_color] + take_3(c[s]) for s in signal_indices if labelled(s)]
|
|
824
|
+
style = [[ut.no_color] + take_3(st[s]) for s in signal_indices if labelled(s)]
|
|
825
|
+
(
|
|
826
|
+
[
|
|
827
|
+
[
|
|
828
|
+
self.matrix.insert_element(
|
|
829
|
+
col_start + side_width + i,
|
|
830
|
+
row_end - 1 - s,
|
|
831
|
+
marker[s][i],
|
|
832
|
+
color[s][i],
|
|
833
|
+
style[s][i],
|
|
834
|
+
)
|
|
835
|
+
for i in range(3)
|
|
836
|
+
]
|
|
837
|
+
for s in range(label_count)
|
|
838
|
+
]
|
|
839
|
+
if legend_test
|
|
840
|
+
else None
|
|
841
|
+
)
|
|
842
|
+
(
|
|
843
|
+
[
|
|
844
|
+
self.matrix.add_horizontal_string(
|
|
845
|
+
col_start + side_width + 3,
|
|
846
|
+
row_end - 1 - s,
|
|
847
|
+
labels[s],
|
|
848
|
+
self.ticks_color,
|
|
849
|
+
self.ticks_style,
|
|
850
|
+
)
|
|
851
|
+
for s in range(label_count)
|
|
852
|
+
]
|
|
853
|
+
if legend_test
|
|
854
|
+
else None
|
|
855
|
+
)
|
|
263
856
|
|
|
264
857
|
# Add Text to Canvas
|
|
265
|
-
[
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
858
|
+
[
|
|
859
|
+
self.matrix.add_multiple_horizontal_strings(
|
|
860
|
+
col_start + tcticks[s],
|
|
861
|
+
row_start + trticks[s],
|
|
862
|
+
self.text[s],
|
|
863
|
+
self.tfull[s],
|
|
864
|
+
self.tstyle[s],
|
|
865
|
+
self.tback[s],
|
|
866
|
+
self.talign[s],
|
|
867
|
+
False,
|
|
868
|
+
True,
|
|
869
|
+
)
|
|
870
|
+
for s in text_indices
|
|
871
|
+
if self.torien[s] is self.default.orientation[0]
|
|
872
|
+
]
|
|
873
|
+
[
|
|
874
|
+
self.matrix.add_multiple_vertical_strings(
|
|
875
|
+
col_start + tcticks[s],
|
|
876
|
+
row_start + trticks[s],
|
|
877
|
+
self.text[s],
|
|
878
|
+
self.tfull[s],
|
|
879
|
+
self.tstyle[s],
|
|
880
|
+
self.tback[s],
|
|
881
|
+
self.talign[s],
|
|
882
|
+
True,
|
|
883
|
+
)
|
|
884
|
+
for s in text_indices
|
|
885
|
+
if self.torien[s] is self.default.orientation[1]
|
|
886
|
+
]
|