plotext-plus 1.0.9__py3-none-any.whl → 1.0.10__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.10.dist-info}/METADATA +7 -2
- plotext_plus-1.0.10.dist-info/RECORD +33 -0
- plotext_plus-1.0.9.dist-info/RECORD +0 -33
- {plotext_plus-1.0.9.dist-info → plotext_plus-1.0.10.dist-info}/WHEEL +0 -0
- {plotext_plus-1.0.9.dist-info → plotext_plus-1.0.10.dist-info}/entry_points.txt +0 -0
- {plotext_plus-1.0.9.dist-info → plotext_plus-1.0.10.dist-info}/licenses/LICENSE +0 -0
plotext_plus/core.py
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
# /usr/bin/env python3
|
|
2
|
-
# -*- coding: utf-8 -*-
|
|
3
2
|
|
|
4
3
|
# This file contains all the main plotext functions available externally to the user
|
|
5
4
|
|
|
@@ -7,384 +6,752 @@
|
|
|
7
6
|
########### Initialisation #############
|
|
8
7
|
##############################################
|
|
9
8
|
|
|
10
|
-
import plotext_plus._doc
|
|
11
|
-
from plotext_plus._doc_utils import documentation as doc
|
|
12
|
-
from plotext_plus._doc_utils import add
|
|
13
|
-
|
|
14
|
-
from ._figure import _figure_class
|
|
15
9
|
from time import sleep as _sleep
|
|
16
|
-
|
|
10
|
+
|
|
17
11
|
from plotext import __version__
|
|
12
|
+
|
|
13
|
+
import plotext_plus._global as _glob
|
|
18
14
|
import plotext_plus._utility as _ut
|
|
15
|
+
from plotext_plus._doc_utils import add
|
|
19
16
|
|
|
20
|
-
_figure =
|
|
17
|
+
_figure = (
|
|
18
|
+
_glob.figure
|
|
19
|
+
) # the main figure at top level (defined in _global.py because it is useful also there)
|
|
21
20
|
|
|
22
21
|
##############################################
|
|
23
22
|
######### Subplots Functions ###########
|
|
24
23
|
##############################################
|
|
25
24
|
|
|
26
|
-
|
|
25
|
+
|
|
26
|
+
def subplots(rows=None, cols=None):
|
|
27
27
|
sub = _figure._active.subplots(rows, cols)
|
|
28
28
|
_figure.show() if _figure._interactive else None
|
|
29
29
|
return sub
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
|
|
32
|
+
def subplot(row=None, col=None):
|
|
32
33
|
sub = _figure.subplot(row, col)
|
|
33
34
|
_figure.show() if _figure._interactive else None
|
|
34
35
|
return sub
|
|
35
36
|
|
|
37
|
+
|
|
36
38
|
def main():
|
|
37
39
|
return _figure.main()
|
|
38
40
|
|
|
41
|
+
|
|
39
42
|
def active():
|
|
40
43
|
return _figure._active
|
|
41
44
|
|
|
45
|
+
|
|
42
46
|
##############################################
|
|
43
47
|
####### Outside Set Functions ##########
|
|
44
48
|
##############################################
|
|
45
49
|
|
|
46
|
-
|
|
50
|
+
|
|
51
|
+
def interactive(interactive=None):
|
|
47
52
|
_figure._set_interactive(interactive)
|
|
48
53
|
|
|
49
|
-
|
|
54
|
+
|
|
55
|
+
def plot_size(width=None, height=None):
|
|
50
56
|
size = _figure._active.plot_size(width, height)
|
|
51
57
|
_figure.show() if _figure._interactive else None
|
|
52
58
|
return size
|
|
59
|
+
|
|
60
|
+
|
|
53
61
|
plotsize = plot_size
|
|
54
62
|
|
|
55
|
-
|
|
56
|
-
|
|
63
|
+
|
|
64
|
+
def limit_size(width=None, height=None):
|
|
65
|
+
# _figure._master._set_size()
|
|
57
66
|
_figure._master._limit_size(width, height)
|
|
67
|
+
|
|
68
|
+
|
|
58
69
|
limitsize = limit_size
|
|
59
70
|
|
|
71
|
+
|
|
60
72
|
def take_min():
|
|
61
73
|
_figure._active.take_min()
|
|
74
|
+
|
|
75
|
+
|
|
62
76
|
takemin = take_min
|
|
63
77
|
|
|
78
|
+
|
|
64
79
|
def title(label):
|
|
65
80
|
_figure._active.title(label)
|
|
66
81
|
_figure.show() if _figure._interactive else None
|
|
67
82
|
|
|
68
|
-
|
|
69
|
-
|
|
83
|
+
|
|
84
|
+
def xlabel(label=None, xside=None):
|
|
85
|
+
_figure._active.xlabel(label=label, xside=xside)
|
|
70
86
|
_figure.show() if _figure._interactive else None
|
|
71
87
|
|
|
72
|
-
|
|
73
|
-
|
|
88
|
+
|
|
89
|
+
def ylabel(label=None, yside=None):
|
|
90
|
+
_figure._active.ylabel(label=label, yside=yside)
|
|
74
91
|
_figure.show() if _figure._interactive else None
|
|
75
92
|
|
|
76
|
-
|
|
77
|
-
|
|
93
|
+
|
|
94
|
+
def xlim(left=None, right=None, xside=None):
|
|
95
|
+
_figure._active.xlim(left=left, right=right, xside=xside)
|
|
78
96
|
_figure.show() if _figure._interactive else None
|
|
79
97
|
|
|
80
|
-
|
|
81
|
-
|
|
98
|
+
|
|
99
|
+
def ylim(lower=None, upper=None, yside=None):
|
|
100
|
+
_figure._active.ylim(lower=lower, upper=upper, yside=yside)
|
|
82
101
|
_figure.show() if _figure._interactive else None
|
|
83
102
|
|
|
84
|
-
|
|
85
|
-
|
|
103
|
+
|
|
104
|
+
def xscale(scale=None, xside=None):
|
|
105
|
+
_figure._active.xscale(scale=scale, xside=xside)
|
|
86
106
|
_figure.show() if _figure._interactive else None
|
|
87
107
|
|
|
88
|
-
|
|
89
|
-
|
|
108
|
+
|
|
109
|
+
def yscale(scale=None, yside=None):
|
|
110
|
+
_figure._active.yscale(scale=scale, yside=yside)
|
|
90
111
|
_figure.show() if _figure._interactive else None
|
|
91
112
|
|
|
92
|
-
|
|
93
|
-
|
|
113
|
+
|
|
114
|
+
def xticks(ticks=None, labels=None, xside=None):
|
|
115
|
+
_figure._active.xticks(ticks=ticks, labels=labels, xside=xside)
|
|
94
116
|
_figure.show() if _figure._interactive else None
|
|
95
117
|
|
|
96
|
-
|
|
97
|
-
|
|
118
|
+
|
|
119
|
+
def yticks(ticks=None, labels=None, yside=None):
|
|
120
|
+
_figure._active.yticks(ticks=ticks, labels=labels, yside=yside)
|
|
98
121
|
_figure.show() if _figure._interactive else None
|
|
99
122
|
|
|
100
|
-
|
|
101
|
-
|
|
123
|
+
|
|
124
|
+
def xfrequency(frequency=None, xside=None):
|
|
125
|
+
_figure._active.xfrequency(frequency=frequency, xside=xside)
|
|
102
126
|
_figure.show() if _figure._interactive else None
|
|
103
127
|
|
|
104
|
-
|
|
105
|
-
|
|
128
|
+
|
|
129
|
+
def yfrequency(frequency=None, yside=None):
|
|
130
|
+
_figure._active.yfrequency(frequency=frequency, yside=yside)
|
|
106
131
|
_figure.show() if _figure._interactive else None
|
|
107
132
|
|
|
108
|
-
|
|
109
|
-
|
|
133
|
+
|
|
134
|
+
def xreverse(reverse=None, xside=None):
|
|
135
|
+
_figure._active.xreverse(reverse=reverse, xside=xside)
|
|
110
136
|
_figure.show() if _figure._interactive else None
|
|
111
137
|
|
|
112
|
-
|
|
113
|
-
|
|
138
|
+
|
|
139
|
+
def yreverse(reverse=None, yside=None):
|
|
140
|
+
_figure._active.yreverse(reverse=reverse, yside=yside)
|
|
114
141
|
_figure.show() if _figure._interactive else None
|
|
115
142
|
|
|
116
|
-
|
|
117
|
-
|
|
143
|
+
|
|
144
|
+
def xaxes(lower=None, upper=None):
|
|
145
|
+
_figure._active.xaxes(lower=lower, upper=upper)
|
|
118
146
|
_figure.show() if _figure._interactive else None
|
|
119
147
|
|
|
120
|
-
|
|
121
|
-
|
|
148
|
+
|
|
149
|
+
def yaxes(left=None, right=None):
|
|
150
|
+
_figure._active.yaxes(left=left, right=right)
|
|
122
151
|
_figure.show() if _figure._interactive else None
|
|
123
152
|
|
|
124
|
-
|
|
125
|
-
|
|
153
|
+
|
|
154
|
+
def frame(frame=None):
|
|
155
|
+
_figure._active.frame(frame=frame)
|
|
126
156
|
_figure.show() if _figure._interactive else None
|
|
127
157
|
|
|
128
|
-
|
|
129
|
-
|
|
158
|
+
|
|
159
|
+
def grid(horizontal=None, vertical=None):
|
|
160
|
+
_figure._active.grid(horizontal=horizontal, vertical=vertical)
|
|
130
161
|
_figure.show() if _figure._interactive else None
|
|
131
162
|
|
|
132
|
-
|
|
163
|
+
|
|
164
|
+
def canvas_color(color=None):
|
|
133
165
|
_figure._active.canvas_color(color)
|
|
134
166
|
_figure.show() if _figure._interactive else None
|
|
135
167
|
|
|
136
|
-
|
|
168
|
+
|
|
169
|
+
def axes_color(color=None):
|
|
137
170
|
_figure._active.axes_color(color)
|
|
138
171
|
_figure.show() if _figure._interactive else None
|
|
139
172
|
|
|
140
|
-
|
|
173
|
+
|
|
174
|
+
def ticks_color(color=None):
|
|
141
175
|
_figure._active.ticks_color(color)
|
|
142
176
|
_figure.show() if _figure._interactive else None
|
|
143
177
|
|
|
144
|
-
|
|
178
|
+
|
|
179
|
+
def ticks_style(style=None):
|
|
145
180
|
_figure._active.ticks_style(style)
|
|
146
181
|
_figure.show() if _figure._interactive else None
|
|
147
182
|
|
|
148
|
-
|
|
183
|
+
|
|
184
|
+
def theme(theme=None):
|
|
149
185
|
_figure._active.theme(theme)
|
|
150
186
|
_figure.show() if _figure._interactive else None
|
|
151
187
|
|
|
188
|
+
|
|
152
189
|
##############################################
|
|
153
190
|
########### Clear Functions ############
|
|
154
191
|
##############################################
|
|
155
192
|
|
|
156
|
-
|
|
193
|
+
|
|
194
|
+
def clear_figure():
|
|
157
195
|
_figure._active.clear_figure()
|
|
158
196
|
_figure.show() if _figure._interactive else None
|
|
197
|
+
|
|
198
|
+
|
|
159
199
|
clf = clear_figure
|
|
160
200
|
|
|
161
|
-
|
|
201
|
+
|
|
202
|
+
def clear_data():
|
|
162
203
|
_figure._active.clear_data()
|
|
163
204
|
_figure.show() if _figure._interactive else None
|
|
205
|
+
|
|
206
|
+
|
|
164
207
|
cld = clear_data
|
|
165
208
|
|
|
166
|
-
|
|
209
|
+
|
|
210
|
+
def clear_color():
|
|
167
211
|
_figure._active.clear_color()
|
|
168
212
|
_figure.show() if _figure._interactive else None
|
|
213
|
+
|
|
214
|
+
|
|
169
215
|
clc = clear_color
|
|
170
216
|
|
|
171
|
-
|
|
172
|
-
|
|
217
|
+
|
|
218
|
+
def clear_terminal(lines=None):
|
|
219
|
+
_figure._active.clear_terminal(lines=lines)
|
|
220
|
+
|
|
221
|
+
|
|
173
222
|
clt = clear_terminal
|
|
174
223
|
|
|
175
224
|
##############################################
|
|
176
225
|
###### Main Plotting Functions #########
|
|
177
226
|
##############################################
|
|
178
227
|
|
|
179
|
-
def scatter(*args, marker = None, color = None, style = None, fillx = None, filly = None, xside = None, yside = None, label = None):
|
|
180
|
-
_figure._active.scatter(*args, xside = xside, yside = yside, marker = marker, color = color, style = style, fillx = fillx, filly = filly, label = label)
|
|
181
|
-
_figure.show() if _figure._interactive else None
|
|
182
228
|
|
|
183
|
-
def
|
|
184
|
-
|
|
229
|
+
def scatter(
|
|
230
|
+
*args,
|
|
231
|
+
marker=None,
|
|
232
|
+
color=None,
|
|
233
|
+
style=None,
|
|
234
|
+
fillx=None,
|
|
235
|
+
filly=None,
|
|
236
|
+
xside=None,
|
|
237
|
+
yside=None,
|
|
238
|
+
label=None,
|
|
239
|
+
):
|
|
240
|
+
_figure._active.scatter(
|
|
241
|
+
*args,
|
|
242
|
+
xside=xside,
|
|
243
|
+
yside=yside,
|
|
244
|
+
marker=marker,
|
|
245
|
+
color=color,
|
|
246
|
+
style=style,
|
|
247
|
+
fillx=fillx,
|
|
248
|
+
filly=filly,
|
|
249
|
+
label=label,
|
|
250
|
+
)
|
|
251
|
+
_figure.show() if _figure._interactive else None
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
def plot(
|
|
255
|
+
*args,
|
|
256
|
+
marker=None,
|
|
257
|
+
color=None,
|
|
258
|
+
style=None,
|
|
259
|
+
fillx=None,
|
|
260
|
+
filly=None,
|
|
261
|
+
xside=None,
|
|
262
|
+
yside=None,
|
|
263
|
+
label=None,
|
|
264
|
+
):
|
|
265
|
+
_figure._active.plot(
|
|
266
|
+
*args,
|
|
267
|
+
xside=xside,
|
|
268
|
+
yside=yside,
|
|
269
|
+
marker=marker,
|
|
270
|
+
color=color,
|
|
271
|
+
fillx=fillx,
|
|
272
|
+
filly=filly,
|
|
273
|
+
label=label,
|
|
274
|
+
)
|
|
275
|
+
_figure.show() if _figure._interactive else None
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
def bar(
|
|
281
|
+
*args,
|
|
282
|
+
marker=None,
|
|
283
|
+
color=None,
|
|
284
|
+
fill=None,
|
|
285
|
+
width=None,
|
|
286
|
+
orientation=None,
|
|
287
|
+
minimum=None,
|
|
288
|
+
reset_ticks=None,
|
|
289
|
+
xside=None,
|
|
290
|
+
yside=None,
|
|
291
|
+
label=None,
|
|
292
|
+
):
|
|
293
|
+
_figure._active.bar(
|
|
294
|
+
*args,
|
|
295
|
+
xside=xside,
|
|
296
|
+
yside=yside,
|
|
297
|
+
marker=marker,
|
|
298
|
+
color=color,
|
|
299
|
+
fill=fill,
|
|
300
|
+
width=width,
|
|
301
|
+
orientation=orientation,
|
|
302
|
+
label=label,
|
|
303
|
+
minimum=minimum,
|
|
304
|
+
reset_ticks=reset_ticks,
|
|
305
|
+
)
|
|
306
|
+
_figure.show() if _figure._interactive else None
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
def simple_bar(*args, marker=None, color=None, title=None, width=None):
|
|
310
|
+
_glob.simple_bar(*args, width=width, marker=marker, color=color, title=title)
|
|
311
|
+
_figure.show() if _figure._interactive else None
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
def multiple_bar(
|
|
315
|
+
*args,
|
|
316
|
+
marker=None,
|
|
317
|
+
color=None,
|
|
318
|
+
fill=None,
|
|
319
|
+
width=None,
|
|
320
|
+
orientation=None,
|
|
321
|
+
minimum=None,
|
|
322
|
+
reset_ticks=None,
|
|
323
|
+
xside=None,
|
|
324
|
+
yside=None,
|
|
325
|
+
labels=None,
|
|
326
|
+
):
|
|
327
|
+
_figure._active.multiple_bar(
|
|
328
|
+
*args,
|
|
329
|
+
xside=xside,
|
|
330
|
+
yside=yside,
|
|
331
|
+
marker=marker,
|
|
332
|
+
color=color,
|
|
333
|
+
fill=fill,
|
|
334
|
+
width=width,
|
|
335
|
+
orientation=orientation,
|
|
336
|
+
labels=labels,
|
|
337
|
+
minimum=minimum,
|
|
338
|
+
reset_ticks=reset_ticks,
|
|
339
|
+
)
|
|
340
|
+
_figure.show() if _figure._interactive else None
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
def simple_multiple_bar(
|
|
344
|
+
*args, marker=None, colors=None, title=None, width=None, labels=None
|
|
345
|
+
):
|
|
346
|
+
_glob.simple_multiple_bar(
|
|
347
|
+
*args, width=width, marker=marker, colors=colors, title=title, labels=labels
|
|
348
|
+
)
|
|
349
|
+
_figure.show() if _figure._interactive else None
|
|
350
|
+
|
|
351
|
+
|
|
352
|
+
def stacked_bar(
|
|
353
|
+
*args,
|
|
354
|
+
marker=None,
|
|
355
|
+
color=None,
|
|
356
|
+
fill=None,
|
|
357
|
+
width=None,
|
|
358
|
+
orientation=None,
|
|
359
|
+
minimum=None,
|
|
360
|
+
reset_ticks=None,
|
|
361
|
+
xside=None,
|
|
362
|
+
yside=None,
|
|
363
|
+
labels=None,
|
|
364
|
+
):
|
|
365
|
+
_figure._active.stacked_bar(
|
|
366
|
+
*args,
|
|
367
|
+
xside=xside,
|
|
368
|
+
yside=yside,
|
|
369
|
+
marker=marker,
|
|
370
|
+
color=color,
|
|
371
|
+
fill=fill,
|
|
372
|
+
width=width,
|
|
373
|
+
orientation=orientation,
|
|
374
|
+
labels=labels,
|
|
375
|
+
minimum=minimum,
|
|
376
|
+
reset_ticks=reset_ticks,
|
|
377
|
+
)
|
|
378
|
+
_figure.show() if _figure._interactive else None
|
|
379
|
+
|
|
380
|
+
|
|
381
|
+
def simple_stacked_bar(
|
|
382
|
+
*args, marker=None, colors=None, title=None, width=None, labels=None
|
|
383
|
+
):
|
|
384
|
+
_glob.simple_stacked_bar(
|
|
385
|
+
*args, width=width, marker=marker, colors=colors, title=title, labels=labels
|
|
386
|
+
)
|
|
387
|
+
_figure.show() if _figure._interactive else None
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
def hist(
|
|
391
|
+
data,
|
|
392
|
+
bins=None,
|
|
393
|
+
marker=None,
|
|
394
|
+
color=None,
|
|
395
|
+
fill=None,
|
|
396
|
+
norm=None,
|
|
397
|
+
width=None,
|
|
398
|
+
orientation=None,
|
|
399
|
+
minimum=None,
|
|
400
|
+
xside=None,
|
|
401
|
+
yside=None,
|
|
402
|
+
label=None,
|
|
403
|
+
):
|
|
404
|
+
_figure._active.hist(
|
|
405
|
+
data,
|
|
406
|
+
bins=bins,
|
|
407
|
+
norm=norm,
|
|
408
|
+
xside=xside,
|
|
409
|
+
yside=yside,
|
|
410
|
+
marker=marker,
|
|
411
|
+
color=color,
|
|
412
|
+
fill=fill,
|
|
413
|
+
width=width,
|
|
414
|
+
orientation=orientation,
|
|
415
|
+
label=label,
|
|
416
|
+
minimum=minimum,
|
|
417
|
+
)
|
|
418
|
+
_figure.show() if _figure._interactive else None
|
|
419
|
+
|
|
420
|
+
|
|
421
|
+
def candlestick(
|
|
422
|
+
dates, data, colors=None, orientation=None, xside=None, yside=None, label=None
|
|
423
|
+
):
|
|
424
|
+
_figure._active.candlestick(
|
|
425
|
+
dates,
|
|
426
|
+
data,
|
|
427
|
+
xside=xside,
|
|
428
|
+
yside=yside,
|
|
429
|
+
orientation=orientation,
|
|
430
|
+
colors=colors,
|
|
431
|
+
label=label,
|
|
432
|
+
)
|
|
433
|
+
_figure.show() if _figure._interactive else None
|
|
434
|
+
|
|
435
|
+
|
|
436
|
+
def box(
|
|
437
|
+
*args,
|
|
438
|
+
quintuples=None,
|
|
439
|
+
colors=None,
|
|
440
|
+
fill=None,
|
|
441
|
+
width=None,
|
|
442
|
+
orientation=None,
|
|
443
|
+
minimum=None,
|
|
444
|
+
reset_ticks=None,
|
|
445
|
+
xside=None,
|
|
446
|
+
yside=None,
|
|
447
|
+
label=None,
|
|
448
|
+
):
|
|
449
|
+
_figure._active.box(
|
|
450
|
+
*args,
|
|
451
|
+
xside=xside,
|
|
452
|
+
yside=yside,
|
|
453
|
+
orientation=orientation,
|
|
454
|
+
colors=colors,
|
|
455
|
+
label=label,
|
|
456
|
+
fill=fill,
|
|
457
|
+
width=width,
|
|
458
|
+
minimum=minimum,
|
|
459
|
+
reset_ticks=reset_ticks,
|
|
460
|
+
quintuples=quintuples,
|
|
461
|
+
)
|
|
185
462
|
_figure.show() if _figure._interactive else None
|
|
186
463
|
|
|
187
|
-
def candlestick(dates, data, xside = None, yside = None, orientation = None, colors = None, label = None):
|
|
188
|
-
_figure._active.candlestick(dates, data, xside = xside, yside = yside, orientation = orientation, colors = colors, label = label)
|
|
189
|
-
_figure.show() if _figure._interactive else None
|
|
190
464
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
465
|
+
##############################################
|
|
466
|
+
########### Plotting Tools #############
|
|
467
|
+
##############################################
|
|
194
468
|
|
|
195
|
-
def simple_bar(*args, marker = None, color = None, title = None, width = None):
|
|
196
|
-
_glob.simple_bar(*args, width = width, marker = marker, color = color, title = title)
|
|
197
|
-
_figure.show() if _figure._interactive else None
|
|
198
469
|
|
|
199
|
-
def
|
|
200
|
-
_figure.
|
|
470
|
+
def error(*args, xerr=None, yerr=None, color=None, xside=None, yside=None, label=None):
|
|
471
|
+
_figure.error(
|
|
472
|
+
*args, xerr=xerr, yerr=yerr, xside=xside, yside=yside, color=color, label=label
|
|
473
|
+
)
|
|
201
474
|
_figure.show() if _figure._interactive else None
|
|
202
475
|
|
|
203
|
-
def simple_multiple_bar(*args, marker = None, colors = None, title = None, width = None, labels = None):
|
|
204
|
-
_glob.simple_multiple_bar(*args, width = width, marker = marker, colors = colors, title = title, labels = labels)
|
|
205
|
-
_figure.show() if _figure._interactive else None
|
|
206
476
|
|
|
207
|
-
def
|
|
208
|
-
_figure._active.
|
|
477
|
+
def event_plot(data, marker=None, color=None, orientation=None, side=None):
|
|
478
|
+
_figure._active.event_plot(
|
|
479
|
+
data, orientation=orientation, marker=marker, color=color, side=side
|
|
480
|
+
)
|
|
209
481
|
_figure.show() if _figure._interactive else None
|
|
210
482
|
|
|
211
|
-
def simple_stacked_bar(*args, marker = None, colors = None, title = None, width = None, labels = None):
|
|
212
|
-
_glob.simple_stacked_bar(*args, width = width, marker = marker, colors = colors, title = title, labels = labels)
|
|
213
|
-
_figure.show() if _figure._interactive else None
|
|
214
483
|
|
|
215
|
-
|
|
216
|
-
_figure._active.hist(data, bins = bins, norm = norm, xside = xside, yside = yside, marker = marker, color = color, fill = fill, width = width, orientation = orientation, label = label, minimum = minimum)
|
|
217
|
-
_figure.show() if _figure._interactive else None
|
|
484
|
+
eventplot = event_plot
|
|
218
485
|
|
|
219
|
-
def candlestick(dates, data, colors = None, orientation = None, xside = None, yside = None, label = None):
|
|
220
|
-
_figure._active.candlestick(dates, data, xside = xside, yside = yside, orientation = orientation, colors = colors, label = label)
|
|
221
|
-
_figure.show() if _figure._interactive else None
|
|
222
486
|
|
|
223
|
-
def
|
|
224
|
-
_figure._active.
|
|
487
|
+
def vertical_line(coordinate, color=None, xside=None):
|
|
488
|
+
_figure._active.vertical_line(coordinate, color=color, xside=xside)
|
|
225
489
|
_figure.show() if _figure._interactive else None
|
|
226
490
|
|
|
227
|
-
##############################################
|
|
228
|
-
########### Plotting Tools #############
|
|
229
|
-
##############################################
|
|
230
|
-
|
|
231
|
-
def error(*args, xerr = None, yerr = None, color = None, xside = None, yside = None, label = None):
|
|
232
|
-
_figure.error(*args, xerr = xerr, yerr = yerr, xside = xside, yside = yside, color = color, label = label)
|
|
233
|
-
_figure.show() if _figure._interactive else None
|
|
234
491
|
|
|
235
|
-
|
|
236
|
-
_figure._active.event_plot(data, orientation = orientation, marker = marker, color = color, side = side)
|
|
237
|
-
_figure.show() if _figure._interactive else None
|
|
492
|
+
vline = vertical_line
|
|
238
493
|
|
|
239
|
-
eventplot = event_plot
|
|
240
494
|
|
|
241
|
-
def
|
|
242
|
-
_figure._active.
|
|
495
|
+
def horizontal_line(coordinate, color=None, yside=None):
|
|
496
|
+
_figure._active.horizontal_line(coordinate, color=color, yside=yside)
|
|
243
497
|
_figure.show() if _figure._interactive else None
|
|
244
|
-
vline = vertical_line
|
|
245
498
|
|
|
246
|
-
|
|
247
|
-
_figure._active.horizontal_line(coordinate, color = color, yside = yside)
|
|
248
|
-
_figure.show() if _figure._interactive else None
|
|
499
|
+
|
|
249
500
|
hline = horizontal_line
|
|
250
501
|
|
|
251
|
-
def text(label, x, y, color = None, background = None, style = None, orientation = None, alignment = None, xside = None, yside = None):
|
|
252
|
-
_figure._active.text(label, x, y, xside = xside, yside = yside, color = color, background = background, style = style, orientation = orientation, alignment = alignment)
|
|
253
|
-
_figure.show() if _figure._interactive else None
|
|
254
502
|
|
|
255
|
-
def
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
503
|
+
def text(
|
|
504
|
+
label,
|
|
505
|
+
x,
|
|
506
|
+
y,
|
|
507
|
+
color=None,
|
|
508
|
+
background=None,
|
|
509
|
+
style=None,
|
|
510
|
+
orientation=None,
|
|
511
|
+
alignment=None,
|
|
512
|
+
xside=None,
|
|
513
|
+
yside=None,
|
|
514
|
+
):
|
|
515
|
+
_figure._active.text(
|
|
516
|
+
label,
|
|
517
|
+
x,
|
|
518
|
+
y,
|
|
519
|
+
xside=xside,
|
|
520
|
+
yside=yside,
|
|
521
|
+
color=color,
|
|
522
|
+
background=background,
|
|
523
|
+
style=style,
|
|
524
|
+
orientation=orientation,
|
|
525
|
+
alignment=alignment,
|
|
526
|
+
)
|
|
527
|
+
_figure.show() if _figure._interactive else None
|
|
528
|
+
|
|
529
|
+
|
|
530
|
+
def rectangle(
|
|
531
|
+
x=None,
|
|
532
|
+
y=None,
|
|
533
|
+
marker=None,
|
|
534
|
+
color=None,
|
|
535
|
+
lines=None,
|
|
536
|
+
fill=None,
|
|
537
|
+
xside=None,
|
|
538
|
+
yside=None,
|
|
539
|
+
label=None,
|
|
540
|
+
):
|
|
541
|
+
_figure._active.rectangle(
|
|
542
|
+
x=x,
|
|
543
|
+
y=y,
|
|
544
|
+
xside=xside,
|
|
545
|
+
yside=yside,
|
|
546
|
+
lines=lines,
|
|
547
|
+
marker=marker,
|
|
548
|
+
color=color,
|
|
549
|
+
fill=fill,
|
|
550
|
+
label=label,
|
|
551
|
+
)
|
|
552
|
+
_figure.show() if _figure._interactive else None
|
|
553
|
+
|
|
554
|
+
|
|
555
|
+
def polygon(
|
|
556
|
+
x=None,
|
|
557
|
+
y=None,
|
|
558
|
+
radius=None,
|
|
559
|
+
sides=None,
|
|
560
|
+
marker=None,
|
|
561
|
+
color=None,
|
|
562
|
+
lines=None,
|
|
563
|
+
fill=None,
|
|
564
|
+
xside=None,
|
|
565
|
+
yside=None,
|
|
566
|
+
label=None,
|
|
567
|
+
):
|
|
568
|
+
_figure._active.polygon(
|
|
569
|
+
x=x,
|
|
570
|
+
y=y,
|
|
571
|
+
radius=radius,
|
|
572
|
+
sides=sides,
|
|
573
|
+
xside=xside,
|
|
574
|
+
yside=yside,
|
|
575
|
+
lines=lines,
|
|
576
|
+
marker=marker,
|
|
577
|
+
color=color,
|
|
578
|
+
fill=fill,
|
|
579
|
+
label=label,
|
|
580
|
+
)
|
|
581
|
+
_figure.show() if _figure._interactive else None
|
|
582
|
+
|
|
583
|
+
|
|
584
|
+
def confusion_matrix(actual, predicted, color=None, style=None, labels=None):
|
|
585
|
+
_figure._active.confusion_matrix(
|
|
586
|
+
actual, predicted, labels=labels, color=color, style=style
|
|
587
|
+
)
|
|
261
588
|
_figure.show() if _figure._interactive else None
|
|
262
589
|
|
|
263
|
-
def confusion_matrix(actual, predicted, color = None, style = None, labels = None):
|
|
264
|
-
_figure._active.confusion_matrix(actual, predicted, labels = labels, color = color, style = style)
|
|
265
|
-
_figure.show() if _figure._interactive else None
|
|
266
590
|
|
|
267
591
|
cmatrix = confusion_matrix
|
|
268
592
|
|
|
269
|
-
|
|
270
|
-
|
|
593
|
+
|
|
594
|
+
def indicator(value, label=None, color=None, style=None):
|
|
595
|
+
_figure._active.indicator(value, label=label, color=color, style=style)
|
|
271
596
|
_figure.show() if _figure._interactive else None
|
|
272
597
|
|
|
598
|
+
|
|
273
599
|
##############################################
|
|
274
600
|
############## 2D Plots ################
|
|
275
|
-
##############################################
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
601
|
+
##############################################
|
|
602
|
+
|
|
603
|
+
|
|
604
|
+
def matrix_plot(matrix, marker=None, style=None, fast=False):
|
|
605
|
+
_figure._active.matrix_plot(matrix, marker=marker, style=style, fast=fast)
|
|
279
606
|
_figure.show() if _figure._interactive else None
|
|
280
607
|
|
|
281
|
-
|
|
282
|
-
|
|
608
|
+
|
|
609
|
+
def heatmap(dataframe, color=None, style=None):
|
|
610
|
+
_figure._active.heatmap(dataframe, color=color, style=style)
|
|
283
611
|
_figure.show() if _figure._interactive else None
|
|
284
612
|
|
|
285
|
-
|
|
286
|
-
|
|
613
|
+
|
|
614
|
+
def image_plot(path, marker=None, style=None, fast=False, grayscale=False):
|
|
615
|
+
_figure._active.image_plot(
|
|
616
|
+
path, marker=marker, style=style, grayscale=grayscale, fast=fast
|
|
617
|
+
)
|
|
287
618
|
_figure.show() if _figure._interactive else None
|
|
288
|
-
|
|
619
|
+
|
|
620
|
+
|
|
289
621
|
def play_gif(path):
|
|
290
622
|
_glob.play_gif(path)
|
|
291
623
|
_figure.show() if _figure._interactive else None
|
|
292
624
|
|
|
293
|
-
|
|
625
|
+
|
|
626
|
+
def play_video(path, from_youtube=False):
|
|
294
627
|
_glob.play_video(path, from_youtube)
|
|
295
628
|
_figure.show() if _figure._interactive else None
|
|
296
629
|
|
|
630
|
+
|
|
297
631
|
def play_youtube(url):
|
|
298
632
|
_glob.play_youtube(url)
|
|
299
633
|
_figure.show() if _figure._interactive else None
|
|
300
634
|
|
|
301
|
-
|
|
635
|
+
|
|
636
|
+
def get_youtube(url, path=None, log=True):
|
|
302
637
|
_glob.get_youtube(url, path, log)
|
|
303
638
|
|
|
639
|
+
|
|
304
640
|
##############################################
|
|
305
641
|
########## Build Functions #############
|
|
306
642
|
##############################################
|
|
307
643
|
|
|
644
|
+
|
|
308
645
|
def show():
|
|
309
646
|
_figure.show()
|
|
310
647
|
|
|
648
|
+
|
|
311
649
|
def build():
|
|
312
650
|
return _figure.build()
|
|
313
651
|
|
|
314
|
-
|
|
652
|
+
|
|
653
|
+
def sleep(time=0):
|
|
315
654
|
_sleep(time)
|
|
316
655
|
|
|
317
|
-
|
|
656
|
+
|
|
657
|
+
def time(show=True):
|
|
318
658
|
return _figure._get_time(show)
|
|
319
659
|
|
|
320
|
-
|
|
660
|
+
|
|
661
|
+
def save_fig(path=None, append=False, keep_colors=False):
|
|
321
662
|
_figure.save_fig(path, append, keep_colors)
|
|
663
|
+
|
|
664
|
+
|
|
322
665
|
savefig = save_fig
|
|
323
666
|
|
|
324
|
-
|
|
325
|
-
|
|
667
|
+
|
|
668
|
+
def from_matplotlib(fig, marker=None):
|
|
669
|
+
_glob.from_matplotlib(fig, marker=marker)
|
|
670
|
+
|
|
326
671
|
|
|
327
672
|
##############################################
|
|
328
673
|
########## Output Functions ############
|
|
329
674
|
##############################################
|
|
330
675
|
|
|
331
|
-
|
|
676
|
+
|
|
677
|
+
def banner_mode(enabled=True, title=None):
|
|
332
678
|
"""Enable or disable banner mode for chart output using chuk-term"""
|
|
333
679
|
from plotext_plus._output import set_output_mode
|
|
680
|
+
|
|
334
681
|
set_output_mode(enabled, title)
|
|
335
682
|
|
|
683
|
+
|
|
336
684
|
def output_info(message):
|
|
337
685
|
"""Output info message using chuk-term styling"""
|
|
338
686
|
from plotext_plus._output import info
|
|
687
|
+
|
|
339
688
|
info(message)
|
|
340
689
|
|
|
690
|
+
|
|
341
691
|
def output_success(message):
|
|
342
692
|
"""Output success message using chuk-term styling"""
|
|
343
693
|
from plotext_plus._output import success
|
|
694
|
+
|
|
344
695
|
success(message)
|
|
345
696
|
|
|
697
|
+
|
|
346
698
|
def output_warning(message):
|
|
347
699
|
"""Output warning message using chuk-term styling"""
|
|
348
700
|
from plotext_plus._output import warning
|
|
701
|
+
|
|
349
702
|
warning(message)
|
|
350
703
|
|
|
704
|
+
|
|
351
705
|
def output_error(message):
|
|
352
706
|
"""Output error message using chuk-term styling"""
|
|
353
707
|
from plotext_plus._output import error
|
|
708
|
+
|
|
354
709
|
error(message)
|
|
355
710
|
|
|
711
|
+
|
|
356
712
|
##############################################
|
|
357
713
|
########## Date Functions #############
|
|
358
714
|
##############################################
|
|
359
715
|
|
|
360
|
-
|
|
716
|
+
|
|
717
|
+
def date_form(input_form=None, output_form=None):
|
|
361
718
|
_figure._active.date_form(input_form, output_form)
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
719
|
+
|
|
720
|
+
|
|
721
|
+
def set_time0(string, input_form=None):
|
|
722
|
+
_figure._active.set_time0(string, input_form=input_form)
|
|
723
|
+
|
|
365
724
|
|
|
366
725
|
def today_datetime():
|
|
367
726
|
return _figure._active.today_datetime()
|
|
368
727
|
|
|
369
|
-
|
|
728
|
+
|
|
729
|
+
def today_string(output_form=None):
|
|
370
730
|
return _figure._active.today_string(output_form)
|
|
371
731
|
|
|
372
|
-
def datetime_to_string(datetime, output_form = None):
|
|
373
|
-
return _figure._active.datetime_to_string(datetime, output_form = output_form)
|
|
374
732
|
|
|
375
|
-
def
|
|
376
|
-
return _figure._active.
|
|
733
|
+
def datetime_to_string(datetime, output_form=None):
|
|
734
|
+
return _figure._active.datetime_to_string(datetime, output_form=output_form)
|
|
735
|
+
|
|
736
|
+
|
|
737
|
+
def datetimes_to_strings(datetimes, output_form=None):
|
|
738
|
+
return _figure._active.datetimes_to_strings(datetimes, output_form=output_form)
|
|
739
|
+
|
|
377
740
|
|
|
378
741
|
datetimes_to_string = datetimes_to_strings
|
|
379
742
|
|
|
380
|
-
def string_to_datetime(string, input_form = None):
|
|
381
|
-
return _figure._active.string_to_datetime(string, input_form = input_form)
|
|
382
743
|
|
|
383
|
-
def
|
|
384
|
-
return _figure._active.
|
|
744
|
+
def string_to_datetime(string, input_form=None):
|
|
745
|
+
return _figure._active.string_to_datetime(string, input_form=input_form)
|
|
746
|
+
|
|
747
|
+
|
|
748
|
+
def string_to_time(string, input_form=None): ##########ADD DOC############
|
|
749
|
+
return _figure._active.string_to_time(string, input_form=input_form)
|
|
750
|
+
|
|
751
|
+
|
|
752
|
+
def strings_to_time(string, input_form=None): ##########ADD DOC############
|
|
753
|
+
return _figure._active.strings_to_time(string, input_form=input_form)
|
|
385
754
|
|
|
386
|
-
def strings_to_time(string, input_form = None):##########ADD DOC############
|
|
387
|
-
return _figure._active.strings_to_time(string, input_form = input_form)
|
|
388
755
|
|
|
389
756
|
##############################################
|
|
390
757
|
########## File Functions ############
|
|
@@ -392,68 +759,94 @@ def strings_to_time(string, input_form = None):##########ADD DOC############
|
|
|
392
759
|
|
|
393
760
|
script_folder = _ut.script_folder
|
|
394
761
|
|
|
395
|
-
|
|
396
|
-
|
|
762
|
+
|
|
763
|
+
def parent_folder(path, level=1):
|
|
764
|
+
return _ut.parent_folder(path, level=level)
|
|
765
|
+
|
|
397
766
|
|
|
398
767
|
def join_paths(*args):
|
|
399
768
|
return _ut.join_paths(*args)
|
|
400
769
|
|
|
401
|
-
def save_text(text, path, log = True):
|
|
402
|
-
_ut.save_text(text, path, log = log)
|
|
403
770
|
|
|
404
|
-
def
|
|
405
|
-
|
|
771
|
+
def save_text(text, path, log=True):
|
|
772
|
+
_ut.save_text(text, path, log=log)
|
|
773
|
+
|
|
774
|
+
|
|
775
|
+
def read_data(path, delimiter=None, columns=None, first_row=None, log=True):
|
|
776
|
+
return _ut.read_data(
|
|
777
|
+
path, delimiter=delimiter, columns=columns, first_row=first_row, log=log
|
|
778
|
+
)
|
|
406
779
|
|
|
407
|
-
def write_data(data, path, delimiter = None, columns = None, log = True):
|
|
408
|
-
_ut.write_data(data, path, delimiter = delimiter, columns = columns, log = log)
|
|
409
780
|
|
|
410
|
-
def
|
|
781
|
+
def write_data(data, path, delimiter=None, columns=None, log=True):
|
|
782
|
+
_ut.write_data(data, path, delimiter=delimiter, columns=columns, log=log)
|
|
783
|
+
|
|
784
|
+
|
|
785
|
+
def download(url, path, log=True):
|
|
411
786
|
_ut.download(url, path, log)
|
|
412
787
|
|
|
413
|
-
def delete_file(path, log = True):
|
|
414
|
-
_ut.delete_file(path, log = log)
|
|
415
788
|
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
789
|
+
def delete_file(path, log=True):
|
|
790
|
+
_ut.delete_file(path, log=log)
|
|
791
|
+
|
|
792
|
+
|
|
793
|
+
test_data_url = _glob.test_data_url
|
|
794
|
+
test_bar_data_url = _glob.test_bar_data_url
|
|
795
|
+
test_image_url = _glob.test_image_url
|
|
796
|
+
test_gif_url = _glob.test_gif_url
|
|
797
|
+
test_video_url = _glob.test_video_url
|
|
798
|
+
test_youtube_url = _glob.test_youtube_url
|
|
422
799
|
|
|
423
800
|
##############################################
|
|
424
801
|
########## Other Functions ############
|
|
425
802
|
##############################################
|
|
426
803
|
|
|
427
|
-
|
|
428
|
-
|
|
804
|
+
|
|
805
|
+
def colorize(string, color=None, style=None, background=None, show=False):
|
|
806
|
+
return _ut.colorize(
|
|
807
|
+
string, color=color, style=style, background=background, show=show
|
|
808
|
+
)
|
|
809
|
+
|
|
429
810
|
|
|
430
811
|
def uncolorize(string):
|
|
431
812
|
return _ut.uncolorize(string)
|
|
432
813
|
|
|
814
|
+
|
|
433
815
|
def terminal_size():
|
|
434
816
|
return _ut.terminal_size()
|
|
435
817
|
|
|
818
|
+
|
|
436
819
|
ts = terminal_size
|
|
437
820
|
|
|
821
|
+
|
|
438
822
|
def terminal_width():
|
|
439
823
|
return _ut.terminal_width()
|
|
440
824
|
|
|
825
|
+
|
|
441
826
|
tw = terminal_width
|
|
442
827
|
|
|
828
|
+
|
|
443
829
|
def terminal_height():
|
|
444
830
|
return _ut.terminal_height()
|
|
445
831
|
|
|
832
|
+
|
|
446
833
|
th = terminal_height
|
|
447
834
|
|
|
448
|
-
def sin(periods = 2, length = 200, amplitude = 1, phase = 0, decay = 0):
|
|
449
|
-
return _ut.sin(periods = periods, length = length, amplitude = amplitude, phase = phase, decay = decay)
|
|
450
835
|
|
|
451
|
-
def
|
|
452
|
-
return _ut.
|
|
836
|
+
def sin(periods=2, length=200, amplitude=1, phase=0, decay=0):
|
|
837
|
+
return _ut.sin(
|
|
838
|
+
periods=periods, length=length, amplitude=amplitude, phase=phase, decay=decay
|
|
839
|
+
)
|
|
840
|
+
|
|
841
|
+
|
|
842
|
+
def square(periods=2, length=200, amplitude=1):
|
|
843
|
+
return _ut.square(periods=periods, length=length, amplitude=amplitude)
|
|
844
|
+
|
|
453
845
|
|
|
454
846
|
def transpose(data):
|
|
455
847
|
return _ut.transpose(data)
|
|
456
848
|
|
|
849
|
+
|
|
457
850
|
colors = _glob.colors
|
|
458
851
|
|
|
459
852
|
styles = _glob.styles
|
|
@@ -467,10 +860,10 @@ test = _glob.test
|
|
|
467
860
|
version = __version__
|
|
468
861
|
|
|
469
862
|
platform = _ut.platform
|
|
470
|
-
|
|
863
|
+
|
|
471
864
|
##############################################
|
|
472
865
|
############ Docstrings ###############
|
|
473
|
-
##############################################
|
|
866
|
+
##############################################
|
|
474
867
|
|
|
475
868
|
add(subplots)
|
|
476
869
|
add(subplot)
|
|
@@ -578,4 +971,4 @@ add(colors)
|
|
|
578
971
|
add(styles)
|
|
579
972
|
add(markers)
|
|
580
973
|
add(themes)
|
|
581
|
-
add(test)
|
|
974
|
+
add(test)
|