0
# Demonstrations and Exploration
1
2
Built-in functions for exploring and demonstrating proplot's capabilities, including colormap galleries, color space visualizations, and font collections. These functions help users discover and understand proplot's extensive customization options.
3
4
## Capabilities
5
6
### Demonstration Functions
7
8
```python { .api }
9
def show_cmaps(*args, **kwargs):
10
"""
11
Display available colormaps in organized galleries.
12
13
Parameters:
14
- *args: Colormap categories or names to display
15
- ncols (int): Number of columns in gallery
16
- **kwargs: Additional display parameters
17
18
Displays colormaps by category:
19
- Sequential, diverging, cyclic, qualitative
20
- Custom and user-registered colormaps
21
"""
22
23
def show_channels(*args, **kwargs):
24
"""
25
Display colormap channels across different color spaces.
26
27
Parameters:
28
- *args: Colormap names to analyze
29
- space (str): Color space for channel analysis
30
- **kwargs: Additional analysis parameters
31
32
Shows hue, saturation, luminance progression
33
for perceptual colormap evaluation.
34
"""
35
36
def show_colors(*args, **kwargs):
37
"""
38
Display available named colors in organized swatches.
39
40
Parameters:
41
- *args: Color categories or names to display
42
- ncols (int): Number of columns in display
43
- **kwargs: Additional display parameters
44
45
Displays:
46
- Built-in matplotlib colors
47
- Proplot named colors
48
- User-registered colors
49
"""
50
51
def show_colorspaces(*args, **kwargs):
52
"""
53
Display color space demonstrations and comparisons.
54
55
Parameters:
56
- *args: Color spaces to demonstrate
57
- **kwargs: Additional demonstration parameters
58
59
Demonstrates differences between:
60
- RGB, HCL, HSL, HSV color spaces
61
- Perceptual uniformity comparisons
62
"""
63
64
def show_cycles(*args, **kwargs):
65
"""
66
Display available color cycles for line plotting.
67
68
Parameters:
69
- *args: Color cycle names to display
70
- ncols (int): Number of columns in display
71
- **kwargs: Additional display parameters
72
73
Shows:
74
- Built-in color cycles
75
- Custom and user-registered cycles
76
"""
77
78
def show_fonts(*args, **kwargs):
79
"""
80
Display available fonts with sample text.
81
82
Parameters:
83
- *args: Font families to display
84
- **kwargs: Additional display parameters
85
86
Displays:
87
- System fonts
88
- TeX Gyre fonts (proplot defaults)
89
- User-registered fonts
90
"""
91
```
92
93
## Usage Examples
94
95
```python
96
import proplot as pplt
97
98
# Show all sequential colormaps
99
pplt.show_cmaps('sequential')
100
101
# Show specific colormaps
102
pplt.show_cmaps('viridis', 'plasma', 'cividis')
103
104
# Analyze colormap perceptual properties
105
pplt.show_channels('viridis', 'jet', space='hcl')
106
107
# Display color cycles
108
pplt.show_cycles()
109
110
# Show available colors
111
pplt.show_colors('blue')
112
113
# Font exploration
114
pplt.show_fonts()
115
116
# Color space comparison
117
pplt.show_colorspaces('hcl', 'hsl')
118
```
119
120
These demonstration functions are invaluable for:
121
- Exploring proplot's extensive asset libraries
122
- Understanding color space differences
123
- Selecting appropriate colormaps and colors
124
- Evaluating perceptual uniformity
125
- Discovering available customization options