@@ -251,43 +251,43 @@ def combine_cmaps(
251
251
252
252
Parameters
253
253
----------
254
- *cmaps: Colormap or colormap name (str) to be combined.
255
- nodes: list or numpy array of nodes (float). Defaults: equal divisions.
256
- The blending points between colormaps, in the range [0, 1].
257
- n_rgb_levels: int. Defaults: 256.
258
- Number of RGB levels for each colormap segment.
259
- combined_cmap_name: str. Defaults: "combined_cmap".
260
- name of the combined Colormap.
254
+ *cmaps: Colormap or colormap name (str) to be combined.
255
+ nodes: list or numpy array of nodes (float). Defaults: equal divisions.
256
+ The blending points between colormaps, in the range [0, 1].
257
+ n_rgb_levels: int. Defaults: 256.
258
+ Number of RGB levels for each colormap segment.
259
+ combined_cmap_name: str. Defaults: "combined_cmap".
260
+ name of the combined Colormap.
261
261
262
262
Returns
263
263
-------
264
- Colormap: The composite colormap.
264
+ Colormap: The composite colormap.
265
265
266
266
Raises
267
267
------
268
- TypeError: If the list contains mixed datatypes or invalid
269
- colormap names.
270
- ValueError: If the cmaps contain only one single colormap,
271
- or if the number of nodes is not one less than the number
272
- of colormaps, or if the nodes do not contain incrementing values
273
- between 0.0 and 1.0.
268
+ TypeError: If the list contains mixed datatypes or invalid
269
+ colormap names.
270
+ ValueError: If the cmaps contain only one single colormap,
271
+ or if the number of nodes is not one less than the number
272
+ of colormaps, or if the nodes do not contain incrementing values
273
+ between 0.0 and 1.0.
274
274
275
275
Note
276
276
----
277
- The colormaps are combined from low value to high value end.
277
+ The colormaps are combined from low value to high value end.
278
278
279
279
References
280
280
----------
281
- - https://stackoverflow.com/questions/31051488/combining-two-matplotlib-colormaps/31052741#31052741
281
+ - https://stackoverflow.com/questions/31051488/combining-two-matplotlib-colormaps/31052741#31052741
282
282
283
283
Examples
284
284
--------
285
- Using predefined colormap names::
285
+ Using predefined colormap names::
286
286
>>> custom_cmap_1 = combine_cmaps(
287
287
["ocean", "prism", "coolwarm"], nodes=[0.2, 0.75]
288
288
)
289
289
290
- Using Colormap objects::
290
+ Using Colormap objects::
291
291
>>> cmap_0 = plt.get_cmap("Blues")
292
292
>>> cmap_1 = plt.get_cmap("Oranges")
293
293
>>> cmap_2 = plt.get_cmap("Greens")
0 commit comments