Skip to content

Commit 08088a0

Browse files
committed
DOC: Add references to the mizani color palettes
closes #962
1 parent 7125fd1 commit 08088a0

File tree

1 file changed

+36
-2
lines changed

1 file changed

+36
-2
lines changed

plotnine/scales/scale_color.py

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ class _scale_color_continuous(
4848
class scale_color_hue(_scale_color_discrete):
4949
"""
5050
Qualitative color scale with evenly spaced hues
51+
52+
See Also
53+
--------
54+
mizani.palettes.hue_pal : The palette class that generates colours
55+
in HCL space.
5156
"""
5257

5358
h: InitVar[float | tuple[float, float]] = 15
@@ -78,11 +83,11 @@ class scale_color_hue(_scale_color_discrete):
7883

7984
s: None = field(default=None, repr=False)
8085
"""
81-
Not being use and will be removed in a future version
86+
Not being used and will be removed in a future version
8287
"""
8388
color_space: None = field(default=None, repr=False)
8489
"""
85-
Not being use and will be removed in a future version
90+
Not being used and will be removed in a future version
8691
"""
8792

8893
def __post_init__(self, h, c, l, direction):
@@ -126,6 +131,11 @@ class scale_color_brewer(_scale_color_discrete):
126131
Sequential, diverging and qualitative discrete color scales
127132
128133
See `colorbrewer.org <http://colorbrewer2.org/>`_
134+
135+
See Also
136+
--------
137+
mizani.palette.brewer_pal : The palette class that generates colours
138+
that generates the brewer colors.
129139
"""
130140

131141
type: InitVar[
@@ -177,6 +187,11 @@ class scale_fill_brewer(scale_color_brewer):
177187
class scale_color_grey(_scale_color_discrete):
178188
"""
179189
Sequential grey color scale.
190+
191+
See Also
192+
--------
193+
mizani.palettes.grey_pal : The palette class that generates colours
194+
gray scale color.
180195
"""
181196

182197
start: InitVar[float] = 0.2
@@ -219,6 +234,8 @@ class scale_color_gradient(_scale_color_continuous):
219234
--------
220235
plotnine.scale_color_gradient2
221236
plotnine.scale_color_gradientn
237+
mizani.palettes.gradient_n_pal : The palette class that generates
238+
the colour gradient.
222239
"""
223240

224241
low: InitVar[str] = "#132B43"
@@ -251,6 +268,11 @@ class scale_fill_gradient(scale_color_gradient):
251268
class scale_color_desaturate(_scale_color_continuous):
252269
"""
253270
Create a desaturated color gradient
271+
272+
See Also
273+
--------
274+
mizani.palettes.desaturate_pal : The palette class that generates
275+
the desaturated colours.
254276
"""
255277

256278
color: InitVar[str] = "red"
@@ -294,6 +316,8 @@ class scale_color_gradient2(_scale_color_continuous):
294316
--------
295317
plotnine.scale_color_gradient
296318
plotnine.scale_color_gradientn
319+
mizani.palettes.gradient_n_pal : The palette class that generates
320+
the colour gradient.
297321
"""
298322

299323
low: InitVar[str] = "#832424"
@@ -347,6 +371,8 @@ class scale_color_gradientn(_scale_color_continuous):
347371
--------
348372
plotnine.scale_color_gradient
349373
plotnine.scale_color_gradientn
374+
mizani.palettes.gradient_n_pal : The palette class that generates
375+
the colour gradient.
350376
"""
351377

352378
colors: InitVar[Sequence[str]]
@@ -461,6 +487,8 @@ class scale_color_cmap(_scale_color_continuous):
461487
--------
462488
[](`matplotlib.cm`)
463489
[](`matplotlib.colors`)
490+
mizani.palettes.cmap_pal : The palette class that generates
491+
the colour gradients of this scale.
464492
"""
465493

466494
cmap_name: InitVar[str] = "viridis"
@@ -496,6 +524,8 @@ class scale_color_cmap_d(_scale_color_discrete):
496524
--------
497525
[](`matplotlib.cm`)
498526
[](`matplotlib.colors`)
527+
mizani.palettes.cmap_pal : The palette class that generates
528+
the colours of this scale.
499529
"""
500530

501531
cmap_name: InitVar[str] = "viridis"
@@ -526,6 +556,10 @@ class scale_fill_cmap_d(scale_color_cmap_d):
526556
class scale_color_datetime(scale_datetime, scale_color_cmap): # pyright: ignore[reportIncompatibleVariableOverride]
527557
"""
528558
Datetime color scale
559+
560+
See Also
561+
--------
562+
plotnine.scale_color_cmap : The parent class.
529563
"""
530564

531565
_: KW_ONLY

0 commit comments

Comments
 (0)