Skip to content

Commit dc2399e

Browse files
Docstrings: Add example for the palette() method of the ColorScaleFeatureSpec.
1 parent b5b53a9 commit dc2399e

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

  • python-package/lets_plot/plot

python-package/lets_plot/plot/core.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -950,6 +950,17 @@ def palette(self, n) -> List[str]:
950950
-----
951951
For ColorBrewer palettes, if the requested number of colors exceeds the palette's
952952
maximum size, colors will be interpolated to generate the required number of unique colors.
953+
954+
Examples
955+
--------
956+
.. jupyter-execute::
957+
:linenos:
958+
:emphasize-lines: 3
959+
960+
from lets_plot import *
961+
LetsPlot.setup_html()
962+
scale_color_viridis().palette(5)
963+
953964
"""
954965

955966
from .. import _kbridge

0 commit comments

Comments
 (0)