plotille 5.0.0__tar.gz → 6.0.1__tar.gz
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.
Potentially problematic release.
This version of plotille might be problematic. Click here for more details.
- {plotille-5.0.0 → plotille-6.0.1}/PKG-INFO +218 -171
- {plotille-5.0.0 → plotille-6.0.1}/README.md +209 -155
- {plotille-5.0.0 → plotille-6.0.1}/plotille/__init__.py +12 -16
- {plotille-5.0.0 → plotille-6.0.1}/plotille/_canvas.py +134 -67
- {plotille-5.0.0 → plotille-6.0.1}/plotille/_cmaps.py +44 -31
- plotille-6.0.1/plotille/_cmaps_data.py +1601 -0
- {plotille-5.0.0 → plotille-6.0.1}/plotille/_colors.py +175 -114
- plotille-6.0.1/plotille/_data_metadata.py +103 -0
- {plotille-5.0.0 → plotille-6.0.1}/plotille/_dots.py +48 -32
- plotille-6.0.1/plotille/_figure.py +982 -0
- plotille-6.0.1/plotille/_figure_data.py +295 -0
- plotille-6.0.1/plotille/_graphs.py +373 -0
- {plotille-5.0.0 → plotille-6.0.1}/plotille/_input_formatter.py +83 -51
- plotille-6.0.1/plotille/_util.py +92 -0
- {plotille-5.0.0 → plotille-6.0.1}/plotille/data.py +37 -28
- plotille-6.0.1/pyproject.toml +147 -0
- plotille-5.0.0/LICENSE.txt +0 -21
- plotille-5.0.0/plotille/_cmaps_data.py +0 -1592
- plotille-5.0.0/plotille/_figure.py +0 -602
- plotille-5.0.0/plotille/_figure_data.py +0 -218
- plotille-5.0.0/plotille/_graphs.py +0 -243
- plotille-5.0.0/plotille/_util.py +0 -131
- plotille-5.0.0/pyproject.toml +0 -60
- plotille-5.0.0/setup.py +0 -26
|
@@ -1,33 +1,27 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: plotille
|
|
3
|
-
Version:
|
|
3
|
+
Version: 6.0.1
|
|
4
4
|
Summary: Plot in the terminal using braille dots.
|
|
5
|
-
Home-page: https://github.com/tammoippen/plotille
|
|
6
|
-
License: MIT
|
|
7
5
|
Keywords: plot,scatter,histogram,terminal,braille,unicode,timeseries
|
|
8
6
|
Author: Tammo Ippen
|
|
9
|
-
Author-email: tammo.ippen@posteo.de
|
|
10
|
-
|
|
7
|
+
Author-email: Tammo Ippen <tammo.ippen@posteo.de>
|
|
8
|
+
License-Expression: MIT
|
|
11
9
|
Classifier: Environment :: Console
|
|
12
|
-
Classifier: Intended Audience :: Science/Research
|
|
13
10
|
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Intended Audience :: Science/Research
|
|
14
12
|
Classifier: Programming Language :: Python
|
|
15
13
|
Classifier: Programming Language :: Python :: 3
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.7
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
-
Classifier: Programming Language :: Python :: 3
|
|
22
14
|
Classifier: Programming Language :: Python :: 3.10
|
|
23
15
|
Classifier: Programming Language :: Python :: 3.11
|
|
24
|
-
Classifier: Programming Language :: Python :: 3.
|
|
25
|
-
Classifier: Programming Language :: Python :: 3.
|
|
26
|
-
Classifier: Programming Language :: Python :: 3.
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
27
19
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
28
20
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
29
21
|
Classifier: Topic :: Scientific/Engineering :: Visualization
|
|
30
22
|
Classifier: Topic :: Terminals
|
|
23
|
+
Requires-Python: >=3.10, <4
|
|
24
|
+
Project-URL: Homepage, https://github.com/tammoippen/plotille
|
|
31
25
|
Project-URL: Repository, https://github.com/tammoippen/plotille
|
|
32
26
|
Description-Content-Type: text/markdown
|
|
33
27
|
|
|
@@ -37,14 +31,15 @@ Description-Content-Type: text/markdown
|
|
|
37
31
|
|
|
38
32
|
[](https://github.com/tammoippen/plotille/actions/workflows/CI.yml)
|
|
39
33
|
[](https://codecov.io/gh/tammoippen/plotille)
|
|
40
|
-
[](https://img.shields.io/badge/pypy-3.8%2C%203.9-brightgreen.svg)
|
|
34
|
+
[](https://img.shields.io/badge/cpython-3.10%2C%203.11%2C%203.12%2C%203.13%203.14-brightgreen.svg)
|
|
35
|
+
[](https://img.shields.io/badge/pypy-3.11-brightgreen.svg)
|
|
43
36
|
[](https://pypi.python.org/pypi/plotille)
|
|
44
37
|
[](https://pepy.tech/project/plotille)
|
|
45
38
|
[](https://pypi.python.org/pypi/plotille)
|
|
39
|
+
[](https://github.com/astral-sh/ruff)
|
|
40
|
+
[](https://github.com/astral-sh/uv)
|
|
46
41
|
|
|
47
|
-
Plots, scatter plots, histograms and heatmaps in the terminal using braille dots, and foreground and background colors - with no
|
|
42
|
+
Plots, scatter plots, histograms and heatmaps in the terminal using braille dots, and foreground and background colors - with no dependencies. Make complex figures using the Figure class or make fast and simple plots using graphing function - similar to a very small sibling to matplotlib. Or use the canvas to plot dots, lines and images yourself.
|
|
48
43
|
|
|
49
44
|
Install:
|
|
50
45
|
|
|
@@ -59,7 +54,7 @@ Similar to other libraries:
|
|
|
59
54
|
- like [termgraph](https://github.com/sgeisler/termgraph) (not on pypi), but very different style.
|
|
60
55
|
- like [terminalplot](https://github.com/kressi/terminalplot), but with braille, X/Y-axis, histogram, linear interpolation.
|
|
61
56
|
|
|
62
|
-
Basic support for timeseries plotting is provided with release 3.2: for any `X` or `Y` values you can also add `datetime.datetime
|
|
57
|
+
Basic support for timeseries plotting is provided with release 3.2: for any `X` or `Y` values you can also add `datetime.datetime` or `numpy.datetime64` values. Labels are generated respecting the difference of `x_limits` and `y_limits`.
|
|
63
58
|
|
|
64
59
|
Support for heatmaps using background colors for figures and displaying images binary with braille, or in color with background colors using the canvas - provided with release 4.0
|
|
65
60
|
|
|
@@ -75,11 +70,11 @@ In [3]: X = np.sort(np.random.normal(size=1000))
|
|
|
75
70
|
|
|
76
71
|
### Figure
|
|
77
72
|
|
|
78
|
-
To construct plots the
|
|
73
|
+
To construct plots the recommended way is to use a `Figure`:
|
|
79
74
|
|
|
80
75
|
```python
|
|
81
|
-
In [
|
|
82
|
-
Init signature: plotille.Figure()
|
|
76
|
+
In [4]: plotille.Figure?
|
|
77
|
+
Init signature: plotille.Figure() -> None
|
|
83
78
|
Docstring:
|
|
84
79
|
Figure class to compose multiple plots.
|
|
85
80
|
|
|
@@ -87,17 +82,16 @@ Within a Figure you can easily compose many plots, assign labels to plots
|
|
|
87
82
|
and define the properties of the underlying Canvas. Possible properties that
|
|
88
83
|
can be defined are:
|
|
89
84
|
|
|
90
|
-
width, height: int
|
|
91
|
-
|
|
92
|
-
x_limits:
|
|
93
|
-
|
|
94
|
-
y_limits:
|
|
95
|
-
|
|
96
|
-
color_mode: str
|
|
97
|
-
with_colors: bool
|
|
98
|
-
background:
|
|
99
|
-
x_label, y_label: str
|
|
100
|
-
```
|
|
85
|
+
width, height: int Define the number of characters in X / Y direction
|
|
86
|
+
which are used for plotting.
|
|
87
|
+
x_limits: DataValue Define the X limits of the reference coordinate system,
|
|
88
|
+
that will be plotted.
|
|
89
|
+
y_limits: DataValue Define the Y limits of the reference coordinate system,
|
|
90
|
+
that will be plotted.
|
|
91
|
+
color_mode: str Define the used color mode. See `plotille.color()`.
|
|
92
|
+
with_colors: bool Define, whether to use colors at all.
|
|
93
|
+
background: ColorDefinition Define the background color.
|
|
94
|
+
x_label, y_label: str Define the X / Y axis label.```
|
|
101
95
|
|
|
102
96
|
Basically, you create a `Figure`, define the properties and add your plots. Using the `show()` function, the `Figure` generates the plot using a new canvas:
|
|
103
97
|
|
|
@@ -164,44 +158,47 @@ There are some utility functions for fast graphing of single plots.
|
|
|
164
158
|
In [4]: plotille.plot?
|
|
165
159
|
Signature:
|
|
166
160
|
plotille.plot(
|
|
167
|
-
X,
|
|
168
|
-
Y,
|
|
169
|
-
width=80,
|
|
170
|
-
height=40,
|
|
171
|
-
X_label='X',
|
|
172
|
-
Y_label='Y',
|
|
173
|
-
linesep=
|
|
174
|
-
interp='linear',
|
|
175
|
-
x_min=None,
|
|
176
|
-
x_max=None,
|
|
177
|
-
y_min=None,
|
|
178
|
-
y_max=None,
|
|
179
|
-
lc=None,
|
|
180
|
-
bg=None,
|
|
181
|
-
color_mode='names',
|
|
182
|
-
origin=True,
|
|
183
|
-
marker=None,
|
|
184
|
-
)
|
|
161
|
+
X: Sequence[float | int] | Sequence[datetime.datetime],
|
|
162
|
+
Y: Sequence[float | int] | Sequence[datetime.datetime],
|
|
163
|
+
width: int = 80,
|
|
164
|
+
height: int = 40,
|
|
165
|
+
X_label: str = 'X',
|
|
166
|
+
Y_label: str = 'Y',
|
|
167
|
+
linesep: str = '\n',
|
|
168
|
+
interp: Optional[Literal['linear']] = 'linear',
|
|
169
|
+
x_min: float | int | datetime.datetime | None = None,
|
|
170
|
+
x_max: float | int | datetime.datetime | None = None,
|
|
171
|
+
y_min: float | int | datetime.datetime | None = None,
|
|
172
|
+
y_max: float | int | datetime.datetime | None = None,
|
|
173
|
+
lc: Union[str, int, ColorNames, tuple[int, int, int], Sequence[int], NoneType] = None,
|
|
174
|
+
bg: Union[str, int, ColorNames, tuple[int, int, int], Sequence[int], NoneType] = None,
|
|
175
|
+
color_mode: Literal['names', 'byte', 'rgb'] = 'names',
|
|
176
|
+
origin: bool = True,
|
|
177
|
+
marker: str | None = None,
|
|
178
|
+
) -> str
|
|
185
179
|
Docstring:
|
|
186
180
|
Create plot with X , Y values and linear interpolation between points
|
|
187
181
|
|
|
188
182
|
Parameters:
|
|
189
183
|
X: List[float] X values.
|
|
190
184
|
Y: List[float] Y values. X and Y must have the same number of entries.
|
|
191
|
-
width: int The number of characters for the width (columns) of the
|
|
192
|
-
|
|
185
|
+
width: int The number of characters for the width (columns) of the
|
|
186
|
+
canvas.
|
|
187
|
+
height: int The number of characters for the hight (rows) of the
|
|
188
|
+
canvas.
|
|
193
189
|
X_label: str Label for X-axis.
|
|
194
|
-
Y_label: str Label for Y-axis. max 8 characters.
|
|
195
|
-
linesep: str The requested line
|
|
190
|
+
Y_label: str Label for Y-axis. max 8 characters. linesep: str The requested line separator. default: os.linesep
|
|
191
|
+
linesep: str The requested line separator. default: os.linesep
|
|
196
192
|
interp: Optional[str] Specify interpolation; values None, 'linear'
|
|
197
193
|
x_min, x_max: float Limits for the displayed X values.
|
|
198
194
|
y_min, y_max: float Limits for the displayed Y values.
|
|
199
|
-
lc:
|
|
200
|
-
bg:
|
|
201
|
-
color_mode:
|
|
202
|
-
see plotille.color.__docs__
|
|
195
|
+
lc: ColorDefinition Give the line color.
|
|
196
|
+
bg: ColorDefinition Give the background color.
|
|
197
|
+
color_mode: ColorMode Specify color input mode; 'names' (default), 'byte' or
|
|
198
|
+
'rgb' see plotille.color.__docs__
|
|
203
199
|
origin: bool Whether to print the origin. default: True
|
|
204
|
-
marker: str Instead of braille dots set a marker char for actual
|
|
200
|
+
marker: str Instead of braille dots set a marker char for actual
|
|
201
|
+
values.
|
|
205
202
|
|
|
206
203
|
Returns:
|
|
207
204
|
str: plot over `X`, `Y`.
|
|
@@ -217,23 +214,23 @@ In [5]: print(plotille.plot(X, np.sin(X), height=30, width=60))
|
|
|
217
214
|
In [6]: plotille.scatter?
|
|
218
215
|
Signature:
|
|
219
216
|
plotille.scatter(
|
|
220
|
-
X,
|
|
221
|
-
Y,
|
|
222
|
-
width=80,
|
|
223
|
-
height=40,
|
|
224
|
-
X_label='X',
|
|
225
|
-
Y_label='Y',
|
|
226
|
-
linesep='\n',
|
|
227
|
-
x_min=None,
|
|
228
|
-
x_max=None,
|
|
229
|
-
y_min=None,
|
|
230
|
-
y_max=None,
|
|
231
|
-
lc=None,
|
|
232
|
-
bg=None,
|
|
233
|
-
color_mode='names',
|
|
234
|
-
origin=True,
|
|
235
|
-
marker=None,
|
|
236
|
-
)
|
|
217
|
+
X: Sequence[float | int] | Sequence[datetime.datetime],
|
|
218
|
+
Y: Sequence[float | int] | Sequence[datetime.datetime],
|
|
219
|
+
width: int = 80,
|
|
220
|
+
height: int = 40,
|
|
221
|
+
X_label: str = 'X',
|
|
222
|
+
Y_label: str = 'Y',
|
|
223
|
+
linesep: str = '\n',
|
|
224
|
+
x_min: float | int | datetime.datetime | None = None,
|
|
225
|
+
x_max: float | int | datetime.datetime | None = None,
|
|
226
|
+
y_min: float | int | datetime.datetime | None = None,
|
|
227
|
+
y_max: float | int | datetime.datetime | None = None,
|
|
228
|
+
lc: Union[str, int, ColorNames, tuple[int, int, int], Sequence[int], NoneType] = None,
|
|
229
|
+
bg: Union[str, int, ColorNames, tuple[int, int, int], Sequence[int], NoneType] = None,
|
|
230
|
+
color_mode: Literal['names', 'byte', 'rgb'] = 'names',
|
|
231
|
+
origin: bool = True,
|
|
232
|
+
marker: str | None = None,
|
|
233
|
+
) -> str
|
|
237
234
|
Docstring:
|
|
238
235
|
Create scatter plot with X , Y values
|
|
239
236
|
|
|
@@ -243,17 +240,19 @@ Basically plotting without interpolation:
|
|
|
243
240
|
Parameters:
|
|
244
241
|
X: List[float] X values.
|
|
245
242
|
Y: List[float] Y values. X and Y must have the same number of entries.
|
|
246
|
-
width: int The number of characters for the width (columns) of the
|
|
247
|
-
|
|
243
|
+
width: int The number of characters for the width (columns) of the
|
|
244
|
+
canvas.
|
|
245
|
+
height: int The number of characters for the hight (rows) of the
|
|
246
|
+
canvas. X_label: str Label for X-axis.
|
|
248
247
|
X_label: str Label for X-axis.
|
|
249
248
|
Y_label: str Label for Y-axis. max 8 characters.
|
|
250
|
-
linesep: str The requested line
|
|
249
|
+
linesep: str The requested line separator. default: os.linesep
|
|
251
250
|
x_min, x_max: float Limits for the displayed X values.
|
|
252
251
|
y_min, y_max: float Limits for the displayed Y values.
|
|
253
|
-
lc:
|
|
254
|
-
bg:
|
|
255
|
-
color_mode:
|
|
256
|
-
see plotille.color.__docs__
|
|
252
|
+
lc: ColorDefinition Give the line color.
|
|
253
|
+
bg: ColorDefinition Give the background color.
|
|
254
|
+
color_mode: ColorMode Specify color input mode; 'names' (default), 'byte' or
|
|
255
|
+
'rgb' see plotille.color.__docs__
|
|
257
256
|
origin: bool Whether to print the origin. default: True
|
|
258
257
|
marker: str Instead of braille dots set a marker char.
|
|
259
258
|
|
|
@@ -273,15 +272,15 @@ Inspired by [crappyhist](http://kevinastraight.x10host.com/2013/12/28/python-his
|
|
|
273
272
|
In [8]: plotille.hist?
|
|
274
273
|
Signature:
|
|
275
274
|
plotille.hist(
|
|
276
|
-
X,
|
|
277
|
-
bins=40,
|
|
278
|
-
width=80,
|
|
279
|
-
log_scale=False,
|
|
280
|
-
linesep='\n',
|
|
281
|
-
lc=None,
|
|
282
|
-
bg=None,
|
|
283
|
-
color_mode='names',
|
|
284
|
-
)
|
|
275
|
+
X: Sequence[float | int] | Sequence[datetime.datetime],
|
|
276
|
+
bins: int = 40,
|
|
277
|
+
width: int = 80,
|
|
278
|
+
log_scale: bool = False,
|
|
279
|
+
linesep: str = '\n',
|
|
280
|
+
lc: Union[str, int, ColorNames, tuple[int, int, int], Sequence[int], NoneType] = None,
|
|
281
|
+
bg: Union[str, int, ColorNames, tuple[int, int, int], Sequence[int], NoneType] = None,
|
|
282
|
+
color_mode: Literal['names', 'byte', 'rgb'] = 'names',
|
|
283
|
+
) -> str
|
|
285
284
|
Docstring:
|
|
286
285
|
Create histogram over `X` from left to right
|
|
287
286
|
|
|
@@ -293,11 +292,11 @@ Parameters:
|
|
|
293
292
|
bins: int The number of bins to put X entries in (rows).
|
|
294
293
|
width: int The number of characters for the width (columns).
|
|
295
294
|
log_scale: bool Scale the histogram with `log` function.
|
|
296
|
-
linesep: str The requested line
|
|
297
|
-
lc:
|
|
298
|
-
bg:
|
|
299
|
-
color_mode:
|
|
300
|
-
see plotille.color.__docs__
|
|
295
|
+
linesep: str The requested line separator. default: os.linesep
|
|
296
|
+
lc: ColorDefinition Give the line color.
|
|
297
|
+
bg: ColorDefinition Give the background color.
|
|
298
|
+
color_mode: ColorMode Specify color input mode; 'names' (default), 'byte' or
|
|
299
|
+
'rgb' see plotille.color.__docs__
|
|
301
300
|
|
|
302
301
|
Returns:
|
|
303
302
|
str: histogram over `X` from left to right.
|
|
@@ -319,30 +318,32 @@ only expose access to aggregated values (counts for each bin / bucket).
|
|
|
319
318
|
In [8]: plotille.hist_aggregated?
|
|
320
319
|
Signature:
|
|
321
320
|
plotille.hist_aggregated(
|
|
322
|
-
counts,
|
|
323
|
-
bins,
|
|
324
|
-
width=80,
|
|
325
|
-
log_scale=False,
|
|
326
|
-
linesep='\n',
|
|
327
|
-
lc=None,
|
|
328
|
-
bg=None,
|
|
329
|
-
color_mode='names',
|
|
330
|
-
|
|
321
|
+
counts: list[int],
|
|
322
|
+
bins: Sequence[float],
|
|
323
|
+
width: int = 80,
|
|
324
|
+
log_scale: bool = False,
|
|
325
|
+
linesep: str = '\n',
|
|
326
|
+
lc: Union[str, int, ColorNames, tuple[int, int, int], Sequence[int], NoneType] = None,
|
|
327
|
+
bg: Union[str, int, ColorNames, tuple[int, int, int], Sequence[int], NoneType] = None,
|
|
328
|
+
color_mode: Literal['names', 'byte', 'rgb'] = 'names',
|
|
329
|
+
meta: plotille._data_metadata.DataMetadata | None = None,
|
|
330
|
+
) -> str
|
|
331
331
|
Docstring:
|
|
332
332
|
Create histogram for aggregated data.
|
|
333
333
|
|
|
334
334
|
Parameters:
|
|
335
|
-
counts: List[int]
|
|
336
|
-
bins: List[float]
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
width: int
|
|
340
|
-
log_scale: bool
|
|
341
|
-
linesep: str
|
|
342
|
-
lc:
|
|
343
|
-
bg:
|
|
344
|
-
color_mode:
|
|
345
|
-
|
|
335
|
+
counts: List[int] Counts for each bucket.
|
|
336
|
+
bins: List[float] Limits for the bins for the provided counts: limits for
|
|
337
|
+
bin `i` are `[bins[i], bins[i+1])`.
|
|
338
|
+
Hence, `len(bins) == len(counts) + 1`.
|
|
339
|
+
width: int The number of characters for the width (columns).
|
|
340
|
+
log_scale: bool Scale the histogram with `log` function.
|
|
341
|
+
linesep: str The requested line separator. default: os.linesep
|
|
342
|
+
lc: ColorDefinition Give the line color.
|
|
343
|
+
bg: ColorDefinition Give the background color.
|
|
344
|
+
color_mode: ColorMode Specify color input mode; 'names' (default), 'byte' or
|
|
345
|
+
'rgb' see plotille.color.__docs__
|
|
346
|
+
meta: DataMetadata | None For conversion of datetime values.
|
|
346
347
|
Returns:
|
|
347
348
|
str: histogram over `X` from left to right.
|
|
348
349
|
|
|
@@ -365,21 +366,21 @@ There is also another more 'usual' histogram function available:
|
|
|
365
366
|
In [10]: plotille.histogram?
|
|
366
367
|
Signature:
|
|
367
368
|
plotille.histogram(
|
|
368
|
-
X,
|
|
369
|
-
bins=160,
|
|
370
|
-
width=80,
|
|
371
|
-
height=40,
|
|
372
|
-
X_label='X',
|
|
373
|
-
Y_label='Counts',
|
|
374
|
-
linesep='\n',
|
|
375
|
-
x_min=None,
|
|
376
|
-
x_max=None,
|
|
377
|
-
y_min=None,
|
|
378
|
-
y_max=None,
|
|
379
|
-
lc=None,
|
|
380
|
-
bg=None,
|
|
381
|
-
color_mode='names',
|
|
382
|
-
)
|
|
369
|
+
X: Sequence[float | int] | Sequence[datetime.datetime],
|
|
370
|
+
bins: int = 160,
|
|
371
|
+
width: int = 80,
|
|
372
|
+
height: int = 40,
|
|
373
|
+
X_label: str = 'X',
|
|
374
|
+
Y_label: str = 'Counts',
|
|
375
|
+
linesep: str = '\n',
|
|
376
|
+
x_min: float | int | datetime.datetime | None = None,
|
|
377
|
+
x_max: float | int | datetime.datetime | None = None,
|
|
378
|
+
y_min: float | int | datetime.datetime | None = None,
|
|
379
|
+
y_max: float | int | datetime.datetime | None = None,
|
|
380
|
+
lc: Union[str, int, ColorNames, tuple[int, int, int], Sequence[int], NoneType] = None,
|
|
381
|
+
bg: Union[str, int, ColorNames, tuple[int, int, int], Sequence[int], NoneType] = None,
|
|
382
|
+
color_mode: Literal['names', 'byte', 'rgb'] = 'names',
|
|
383
|
+
) -> str
|
|
383
384
|
Docstring:
|
|
384
385
|
Create histogram over `X`
|
|
385
386
|
|
|
@@ -393,13 +394,13 @@ Parameters:
|
|
|
393
394
|
height: int The number of characters for the height (rows).
|
|
394
395
|
X_label: str Label for X-axis.
|
|
395
396
|
Y_label: str Label for Y-axis. max 8 characters.
|
|
396
|
-
linesep: str The requested line
|
|
397
|
+
linesep: str The requested line separator. default: os.linesep
|
|
397
398
|
x_min, x_max: float Limits for the displayed X values.
|
|
398
399
|
y_min, y_max: float Limits for the displayed Y values.
|
|
399
|
-
lc:
|
|
400
|
-
bg:
|
|
401
|
-
color_mode:
|
|
402
|
-
see plotille.color.__docs__
|
|
400
|
+
lc: ColorDefinition Give the line color.
|
|
401
|
+
bg: ColorDefinition Give the background color.
|
|
402
|
+
color_mode: ColorMode Specify color input mode; 'names' (default), 'byte' or
|
|
403
|
+
'rgb' see plotille.color.__docs__
|
|
403
404
|
|
|
404
405
|
Returns:
|
|
405
406
|
str: histogram over `X`.
|
|
@@ -417,39 +418,42 @@ The underlying plotting area is modeled as the `Canvas` class:
|
|
|
417
418
|
In [12]: plotille.Canvas?
|
|
418
419
|
Init signature:
|
|
419
420
|
plotille.Canvas(
|
|
420
|
-
width,
|
|
421
|
-
height,
|
|
422
|
-
xmin=0,
|
|
423
|
-
ymin=0,
|
|
424
|
-
xmax=1,
|
|
425
|
-
ymax=1,
|
|
426
|
-
background=None,
|
|
427
|
-
**color_kwargs,
|
|
428
|
-
)
|
|
421
|
+
width: int,
|
|
422
|
+
height: int,
|
|
423
|
+
xmin: Union[float, int] = 0,
|
|
424
|
+
ymin: Union[float, int] = 0,
|
|
425
|
+
xmax: Union[float, int] = 1,
|
|
426
|
+
ymax: Union[float, int] = 1,
|
|
427
|
+
background: Union[str, int, ColorNames, tuple[int, int, int], Sequence[int], NoneType] = None,
|
|
428
|
+
**color_kwargs: Any,
|
|
429
|
+
) -> None
|
|
429
430
|
Docstring:
|
|
430
431
|
A canvas object for plotting braille dots
|
|
431
432
|
|
|
432
433
|
A Canvas object has a `width` x `height` characters large canvas, in which it
|
|
433
434
|
can plot indivitual braille point, lines out of braille points, rectangles,...
|
|
434
|
-
Since a full braille character has 2 x 4 dots (⣿), the canvas has `width` * 2,
|
|
435
|
-
dots to plot into in total.
|
|
435
|
+
Since a full braille character has 2 x 4 dots (⣿), the canvas has `width` * 2,
|
|
436
|
+
`height` * 4 dots to plot into in total.
|
|
436
437
|
|
|
437
438
|
It maintains two coordinate systems: a reference system with the limits (xmin, ymin)
|
|
438
439
|
in the lower left corner to (xmax, ymax) in the upper right corner is transformed
|
|
439
|
-
into the canvas discrete, i.e. dots, coordinate system (0, 0) to (`width` * 2,
|
|
440
|
-
It does so transparently to clients of the Canvas, i.e. all plotting
|
|
441
|
-
only accept coordinates in the reference system. If the coordinates are
|
|
442
|
-
the reference system, they are not plotted.
|
|
440
|
+
into the canvas discrete, i.e. dots, coordinate system (0, 0) to (`width` * 2,
|
|
441
|
+
`height` * 4). It does so transparently to clients of the Canvas, i.e. all plotting
|
|
442
|
+
functions only accept coordinates in the reference system. If the coordinates are
|
|
443
|
+
outside the reference system, they are not plotted.
|
|
443
444
|
Init docstring:
|
|
444
445
|
Initiate a Canvas object
|
|
445
446
|
|
|
446
447
|
Parameters:
|
|
447
|
-
width: int The number of characters for the width (columns) of
|
|
448
|
-
|
|
448
|
+
width: int The number of characters for the width (columns) of
|
|
449
|
+
the canvas.
|
|
450
|
+
height: int The number of characters for the hight (rows) of the
|
|
451
|
+
canvas.
|
|
449
452
|
xmin, ymin: float Lower left corner of reference system.
|
|
450
453
|
xmax, ymax: float Upper right corner of reference system.
|
|
451
454
|
background: multiple Background color of the canvas.
|
|
452
|
-
**color_kwargs: More arguments to the color-function.
|
|
455
|
+
**color_kwargs: More arguments to the color-function.
|
|
456
|
+
See `plotille.color()`.
|
|
453
457
|
|
|
454
458
|
Returns:
|
|
455
459
|
Canvas object
|
|
@@ -461,7 +465,15 @@ _point:_
|
|
|
461
465
|
|
|
462
466
|
```python
|
|
463
467
|
In [11]: plotille.Canvas.point?
|
|
464
|
-
Signature:
|
|
468
|
+
Signature:
|
|
469
|
+
plotille.Canvas.point(
|
|
470
|
+
self,
|
|
471
|
+
x: Union[float, int],
|
|
472
|
+
y: Union[float, int],
|
|
473
|
+
set_: bool = True,
|
|
474
|
+
color: Union[str, int, ColorNames, tuple[int, int, int], Sequence[int], NoneType] = None,
|
|
475
|
+
marker: str | None = None,
|
|
476
|
+
) -> None
|
|
465
477
|
Docstring:
|
|
466
478
|
Put a point into the canvas at (x, y) [reference coordinate system]
|
|
467
479
|
|
|
@@ -477,7 +489,16 @@ _line:_
|
|
|
477
489
|
|
|
478
490
|
```python
|
|
479
491
|
In [14]: plotille.Canvas.line?
|
|
480
|
-
Signature:
|
|
492
|
+
Signature:
|
|
493
|
+
plotille.Canvas.line(
|
|
494
|
+
self,
|
|
495
|
+
x0: Union[float, int],
|
|
496
|
+
y0: Union[float, int],
|
|
497
|
+
x1: Union[float, int],
|
|
498
|
+
y1: Union[float, int],
|
|
499
|
+
set_: bool = True,
|
|
500
|
+
color: Union[str, int, ColorNames, tuple[int, int, int], Sequence[int], NoneType] = None,
|
|
501
|
+
) -> None
|
|
481
502
|
Docstring:
|
|
482
503
|
Plot line between point (x0, y0) and (x1, y1) [reference coordinate system].
|
|
483
504
|
|
|
@@ -492,9 +513,20 @@ _rect:_
|
|
|
492
513
|
|
|
493
514
|
```python
|
|
494
515
|
In [15]: plotille.Canvas.rect?
|
|
495
|
-
Signature:
|
|
516
|
+
Signature:
|
|
517
|
+
plotille.Canvas.rect(
|
|
518
|
+
self,
|
|
519
|
+
xmin: Union[float, int],
|
|
520
|
+
ymin: Union[float, int],
|
|
521
|
+
xmax: Union[float, int],
|
|
522
|
+
ymax: Union[float, int],
|
|
523
|
+
set_: bool = True,
|
|
524
|
+
color: Union[str, int, ColorNames, tuple[int, int, int], Sequence[int], NoneType] = None,
|
|
525
|
+
) -> None
|
|
496
526
|
Docstring:
|
|
497
|
-
Plot rectangle with bbox (xmin, ymin) and (xmax, ymax)
|
|
527
|
+
Plot rectangle with bbox (xmin, ymin) and (xmax, ymax).
|
|
528
|
+
|
|
529
|
+
In the reference coordinate system.
|
|
498
530
|
|
|
499
531
|
Parameters:
|
|
500
532
|
xmin, ymin: float Lower left corner of rectangle.
|
|
@@ -507,7 +539,15 @@ _text:_
|
|
|
507
539
|
|
|
508
540
|
```python
|
|
509
541
|
In [16]: plotille.Canvas.text?
|
|
510
|
-
Signature:
|
|
542
|
+
Signature:
|
|
543
|
+
plotille.Canvas.text(
|
|
544
|
+
self,
|
|
545
|
+
x: Union[float, int],
|
|
546
|
+
y: Union[float, int],
|
|
547
|
+
text: str,
|
|
548
|
+
set_: bool = True,
|
|
549
|
+
color: Union[str, int, ColorNames, tuple[int, int, int], Sequence[int], NoneType] = None,
|
|
550
|
+
) -> None
|
|
511
551
|
Docstring:
|
|
512
552
|
Put some text into the canvas at (x, y) [reference coordinate system]
|
|
513
553
|
|
|
@@ -526,11 +566,12 @@ In [17]: plotille.Canvas.braille_image?
|
|
|
526
566
|
Signature:
|
|
527
567
|
plotille.Canvas.braille_image(
|
|
528
568
|
self,
|
|
529
|
-
pixels,
|
|
530
|
-
threshold=127,
|
|
531
|
-
inverse=False,
|
|
532
|
-
|
|
533
|
-
|
|
569
|
+
pixels: Sequence[int],
|
|
570
|
+
threshold: int = 127,
|
|
571
|
+
inverse: bool = False,
|
|
572
|
+
color: Union[str, int, ColorNames, tuple[int, int, int], Sequence[int], NoneType] = None,
|
|
573
|
+
set_: bool = True,
|
|
574
|
+
) -> None
|
|
534
575
|
Docstring:
|
|
535
576
|
Print an image using braille dots into the canvas.
|
|
536
577
|
|
|
@@ -553,6 +594,7 @@ Parameters:
|
|
|
553
594
|
threshold: float All pixels above this threshold will be
|
|
554
595
|
drawn.
|
|
555
596
|
inverse: bool Whether to invert the image.
|
|
597
|
+
color: multiple Color of the point.
|
|
556
598
|
set_: bool Whether to plot or remove the dots.
|
|
557
599
|
```
|
|
558
600
|
|
|
@@ -560,7 +602,12 @@ _image:_
|
|
|
560
602
|
|
|
561
603
|
```python
|
|
562
604
|
In [18]: plotille.Canvas.image?
|
|
563
|
-
Signature:
|
|
605
|
+
Signature:
|
|
606
|
+
plotille.Canvas.image(
|
|
607
|
+
self,
|
|
608
|
+
pixels: Sequence[tuple[int, int, int] | Sequence[int] | None],
|
|
609
|
+
set_: bool = True,
|
|
610
|
+
) -> None
|
|
564
611
|
Docstring:
|
|
565
612
|
Print an image using background colors into the canvas.
|
|
566
613
|
|
|
@@ -588,12 +635,12 @@ _plot:_
|
|
|
588
635
|
|
|
589
636
|
```python
|
|
590
637
|
In [16]: plotille.Canvas.plot?
|
|
591
|
-
Signature: plotille.Canvas.plot(self, linesep='\n')
|
|
638
|
+
Signature: plotille.Canvas.plot(self, linesep: str = '\n') -> str
|
|
592
639
|
Docstring:
|
|
593
640
|
Transform canvas into `print`-able string
|
|
594
641
|
|
|
595
642
|
Parameters:
|
|
596
|
-
linesep: str The requested line
|
|
643
|
+
linesep: str The requested line separator. default: os.linesep
|
|
597
644
|
|
|
598
645
|
Returns:
|
|
599
646
|
unicode: The canvas as a string.
|