Skip to content

Commit 1892fb3

Browse files
committed
Add missing scale_stroke_identity
1 parent 261bf65 commit 1892fb3

File tree

5 files changed

+20
-0
lines changed

5 files changed

+20
-0
lines changed

doc/_quartodoc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ quartodoc:
252252
- scale_linetype_identity
253253
- scale_shape_identity
254254
- scale_size_identity
255+
- scale_stroke_identity
255256

256257
- subtitle: Linetype Scales
257258
options: *no-members

doc/changelog.qmd

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ title: Changelog
55
## v0.15.1
66
(not-yet-released)
77

8+
### New
9+
10+
- Added [](:class:`~plotnine.scale_stroke_identity`) which was conspicuously missing!
11+
812
### Bug Fixes
913

1014
- Fixed labels set with the `labs` call so that they are only ever overwritten

plotnine/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@
198198
scale_size_radius,
199199
scale_stroke,
200200
scale_stroke_continuous,
201+
scale_stroke_identity,
201202
scale_x_continuous,
202203
scale_x_date,
203204
scale_x_datetime,
@@ -441,6 +442,7 @@
441442
"scale_size_radius",
442443
"scale_stroke",
443444
"scale_stroke_continuous",
445+
"scale_stroke_identity",
444446
"scale_x_continuous",
445447
"scale_x_date",
446448
"scale_x_datetime",

plotnine/scales/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
scale_linetype_identity,
7575
scale_shape_identity,
7676
scale_size_identity,
77+
scale_stroke_identity,
7778
)
7879

7980
# linetype
@@ -217,6 +218,7 @@
217218
"scale_linetype_identity",
218219
"scale_shape_identity",
219220
"scale_size_identity",
221+
"scale_stroke_identity",
220222
# manual
221223
"scale_color_manual",
222224
"scale_colour_manual",

plotnine/scales/scale_identity.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,17 @@ class scale_size_identity(
106106
guide: Literal["legend"] | None = None
107107

108108

109+
@dataclass
110+
class scale_stroke_identity(MapTrainMixin, scale_discrete):
111+
"""
112+
No stroke scaling
113+
"""
114+
115+
_aesthetics = ["stroke"]
116+
_: KW_ONLY
117+
guide: Literal["legend"] | None = None
118+
119+
109120
# American to British spelling
110121
@alias
111122
class scale_colour_identity(scale_color_identity):

0 commit comments

Comments
 (0)