Skip to content

Commit 7332919

Browse files
committed
fix: border title
1 parent 7326ca3 commit 7332919

File tree

5 files changed

+34
-28
lines changed

5 files changed

+34
-28
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ Steps to update the version:
2020
In development:
2121
---------------
2222

23+
Fix:
24+
25+
* Missing title parameter from border.
26+
2327
Version 0.3.1
2428
-------------
2529

DOCS.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,13 +1041,13 @@ Inputs:
10411041

10421042
### method border.\_\_repr\_\_
10431043

1044-
**\_\_repr\_\_():** ([source](https://github.com/matomatical/matthewplotlib/blob/main/matthewplotlib/plots.py#L1267))
1044+
**\_\_repr\_\_():** ([source](https://github.com/matomatical/matthewplotlib/blob/main/matthewplotlib/plots.py#L1269))
10451045

10461046
---
10471047

10481048
### class axes
10491049

1050-
**axes(plot):** ([source](https://github.com/matomatical/matthewplotlib/blob/main/matthewplotlib/plots.py#L1271))
1050+
**axes(plot):** ([source](https://github.com/matomatical/matthewplotlib/blob/main/matthewplotlib/plots.py#L1273))
10511051

10521052
Add an annotated border around a scatterplot using box-drawing characters.
10531053

@@ -1081,13 +1081,13 @@ Inputs:
10811081

10821082
### method axes.\_\_repr\_\_
10831083

1084-
**\_\_repr\_\_():** ([source](https://github.com/matomatical/matthewplotlib/blob/main/matthewplotlib/plots.py#L1351))
1084+
**\_\_repr\_\_():** ([source](https://github.com/matomatical/matthewplotlib/blob/main/matthewplotlib/plots.py#L1353))
10851085

10861086
---
10871087

10881088
### class blank
10891089

1090-
**blank(plot):** ([source](https://github.com/matomatical/matthewplotlib/blob/main/matthewplotlib/plots.py#L1359))
1090+
**blank(plot):** ([source](https://github.com/matomatical/matthewplotlib/blob/main/matthewplotlib/plots.py#L1361))
10911091

10921092
Creates a rectangular plot composed entirely of blank space.
10931093

@@ -1102,13 +1102,13 @@ Inputs:
11021102

11031103
### method blank.\_\_repr\_\_
11041104

1105-
**\_\_repr\_\_():** ([source](https://github.com/matomatical/matthewplotlib/blob/main/matthewplotlib/plots.py#L1380))
1105+
**\_\_repr\_\_():** ([source](https://github.com/matomatical/matthewplotlib/blob/main/matthewplotlib/plots.py#L1382))
11061106

11071107
---
11081108

11091109
### class hstack
11101110

1111-
**hstack(plot):** ([source](https://github.com/matomatical/matthewplotlib/blob/main/matthewplotlib/plots.py#L1384))
1111+
**hstack(plot):** ([source](https://github.com/matomatical/matthewplotlib/blob/main/matthewplotlib/plots.py#L1386))
11121112

11131113
Horizontally arrange one or more plots side-by-side.
11141114

@@ -1122,13 +1122,13 @@ Inputs:
11221122

11231123
### method hstack.\_\_repr\_\_
11241124

1125-
**\_\_repr\_\_():** ([source](https://github.com/matomatical/matthewplotlib/blob/main/matthewplotlib/plots.py#L1409))
1125+
**\_\_repr\_\_():** ([source](https://github.com/matomatical/matthewplotlib/blob/main/matthewplotlib/plots.py#L1411))
11261126

11271127
---
11281128

11291129
### class vstack
11301130

1131-
**vstack(plot):** ([source](https://github.com/matomatical/matthewplotlib/blob/main/matthewplotlib/plots.py#L1416))
1131+
**vstack(plot):** ([source](https://github.com/matomatical/matthewplotlib/blob/main/matthewplotlib/plots.py#L1418))
11321132

11331133
Vertically arrange one or more plots, one above the other.
11341134

@@ -1142,13 +1142,13 @@ Inputs:
11421142

11431143
### method vstack.\_\_repr\_\_
11441144

1145-
**\_\_repr\_\_():** ([source](https://github.com/matomatical/matthewplotlib/blob/main/matthewplotlib/plots.py#L1441))
1145+
**\_\_repr\_\_():** ([source](https://github.com/matomatical/matthewplotlib/blob/main/matthewplotlib/plots.py#L1443))
11461146

11471147
---
11481148

11491149
### class dstack
11501150

1151-
**dstack(plot):** ([source](https://github.com/matomatical/matthewplotlib/blob/main/matthewplotlib/plots.py#L1448))
1151+
**dstack(plot):** ([source](https://github.com/matomatical/matthewplotlib/blob/main/matthewplotlib/plots.py#L1450))
11521152

11531153
Overlay one or more plots on top of each other.
11541154

@@ -1164,13 +1164,13 @@ Inputs:
11641164

11651165
### method dstack.\_\_repr\_\_
11661166

1167-
**\_\_repr\_\_():** ([source](https://github.com/matomatical/matthewplotlib/blob/main/matthewplotlib/plots.py#L1486))
1167+
**\_\_repr\_\_():** ([source](https://github.com/matomatical/matthewplotlib/blob/main/matthewplotlib/plots.py#L1488))
11681168

11691169
---
11701170

11711171
### class wrap
11721172

1173-
**wrap(plot):** ([source](https://github.com/matomatical/matthewplotlib/blob/main/matthewplotlib/plots.py#L1493))
1173+
**wrap(plot):** ([source](https://github.com/matomatical/matthewplotlib/blob/main/matthewplotlib/plots.py#L1495))
11741174

11751175
Arrange a sequence of plots into a grid.
11761176

@@ -1189,13 +1189,13 @@ Inputs:
11891189

11901190
### method wrap.\_\_repr\_\_
11911191

1192-
**\_\_repr\_\_():** ([source](https://github.com/matomatical/matthewplotlib/blob/main/matthewplotlib/plots.py#L1550))
1192+
**\_\_repr\_\_():** ([source](https://github.com/matomatical/matthewplotlib/blob/main/matthewplotlib/plots.py#L1552))
11931193

11941194
---
11951195

11961196
### class center
11971197

1198-
**center(plot):** ([source](https://github.com/matomatical/matthewplotlib/blob/main/matthewplotlib/plots.py#L1557))
1198+
**center(plot):** ([source](https://github.com/matomatical/matthewplotlib/blob/main/matthewplotlib/plots.py#L1559))
11991199

12001200
Pad a plot with blank space to center it within a larger area.
12011201

@@ -1216,13 +1216,13 @@ Inputs:
12161216

12171217
### method center.\_\_repr\_\_
12181218

1219-
**\_\_repr\_\_():** ([source](https://github.com/matomatical/matthewplotlib/blob/main/matthewplotlib/plots.py#L1609))
1219+
**\_\_repr\_\_():** ([source](https://github.com/matomatical/matthewplotlib/blob/main/matthewplotlib/plots.py#L1611))
12201220

12211221
---
12221222

12231223
### function save\_animation
12241224

1225-
**save\_animation(plots: Sequence[plot], filename: str, upscale: int, downscale: int, bgcolor: ColorLike | None, fps: int, repeat: bool):** ([source](https://github.com/matomatical/matthewplotlib/blob/main/matthewplotlib/plots.py#L1620))
1225+
**save\_animation(plots: Sequence[plot], filename: str, upscale: int, downscale: int, bgcolor: ColorLike | None, fps: int, repeat: bool):** ([source](https://github.com/matomatical/matthewplotlib/blob/main/matthewplotlib/plots.py#L1622))
12261226

12271227
Supply a list of plots and a filename and this method will create an
12281228
animated gif.

examples/colormaps.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,23 @@
2121
mp.text("test images:"),
2222
mp.hstack(
2323
mp.border(
24-
mp.text("linspace(0,1,256")
25-
/ mp.image(im_continuous),
24+
mp.image(im_continuous),
25+
title="linspace(0,1,256",
2626
),
2727
mp.border(
28-
mp.text("arange(256)/16")
29-
/ mp.image(im_discrete16 / 16),
28+
mp.image(im_discrete16 / 16),
29+
title="arange(256)/16",
3030
),
3131
mp.border(
32-
mp.text("arange(256)/25.6")
33-
/ mp.image(im_discrete10 / 10),
32+
mp.image(im_discrete10 / 10),
33+
title="arange(256)/25.6",
3434
)
3535
),
3636
mp.text("continuous colormaps:"),
3737
mp.wrap(*[
3838
mp.border(
39-
mp.text(c.__name__)
40-
/ mp.image(im_continuous, colormap=c),
39+
mp.image(im_continuous, colormap=c),
40+
title=c.__name__,
4141
)
4242
for c in [
4343
mp.reds, mp.greens, mp.blues, mp.rainbow,
@@ -48,14 +48,14 @@
4848
mp.text("discrete colormaps:"),
4949
mp.wrap(*[
5050
mp.border(
51-
mp.text(c.__name__)
52-
/ mp.image(im_discrete16, colormap=c),
51+
mp.image(im_discrete16, colormap=c),
52+
title=c.__name__,
5353
)
5454
for c in [ mp.sweetie16, mp.pico8 ]
5555
], *[
5656
mp.border(
57-
mp.text(c.__name__)
58-
/ mp.image(im_discrete10, colormap=c),
57+
mp.image(im_discrete10, colormap=c),
58+
title=c.__name__,
5959
)
6060
for c in [ mp.tableau, mp.nouveau ]
6161
], cols=4),

images/colormaps.png

-325 Bytes
Loading

matthewplotlib/plots.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1250,11 +1250,13 @@ class border(plot):
12501250
def __init__(
12511251
self,
12521252
plot: plot,
1253+
title: str = "",
12531254
style: BoxStyle = BoxStyle.ROUND,
12541255
color: ColorLike | None = None,
12551256
):
12561257
chars = unicode_box(
12571258
chars=plot.chars,
1259+
title=title,
12581260
style=style,
12591261
fgcolor=color,
12601262
)

0 commit comments

Comments
 (0)