|
72 | 72 | # Matplotlib colormaps with erratic color transitions like ``'jet'`` are still |
73 | 73 | # registered, but they are hidden from this table by default, and their usage is |
74 | 74 | # discouraged. If you need a list of colors associated with a registered or |
75 | | -# on-the-fly colormap, simply use `~ultraplot.utils.get_colors`. |
| 75 | +# on-the-fly colormap, simply use :func:`~ultraplot.utils.get_colors`. |
76 | 76 | # |
77 | 77 | # .. note:: |
78 | 78 | # |
|
81 | 81 | # and ``'ViRiDiS'`` are equivalent), diverging colormap names can be specified in |
82 | 82 | # their "reversed" form (e.g., ``'BuRd'`` is equivalent to ``'RdBu_r'``), and |
83 | 83 | # appending ``'_r'`` or ``'_s'`` to *any* colormap name will return a |
84 | | -# `~ultraplot.colors.ContinuousColormap.reversed` or |
85 | | -# :property:`~ultraplot.colors.ContinuousColormap.shifted` version of the colormap |
86 | | -# or color cycle. See `~ultraplot.colors.ColormapDatabase` for more info. |
| 84 | +# :attr:`~ultraplot.colors.ContinuousColormap.reversed` or |
| 85 | +# :attr:`~ultraplot.colors.ContinuousColormap.shifted` version of the colormap |
| 86 | +# or color cycle. See :class:`~ultraplot.colors.ColormapDatabase` for more info. |
87 | 87 |
|
88 | 88 | # %% |
89 | 89 | import ultraplot as uplt |
|
119 | 119 | # |
120 | 120 | # The colorspace used by a :class:`~ultraplot.colors.PerceptualColormap` |
121 | 121 | # is set with the `space` keyword arg. To plot arbitrary cross-sections of |
122 | | -# these colorspaces, use `~ultraplot.demos.show_colorspaces` (the black |
| 122 | +# these colorspaces, use :func:`~ultraplot.demos.show_colorspaces` (the black |
123 | 123 | # regions represent impossible colors). To see how colormaps vary with |
124 | | -# respect to each channel, use `~ultraplot.demos.show_channels`. Some examples |
| 124 | +# respect to each channel, use :func:`~ultraplot.demos.show_channels`. Some examples |
125 | 125 | # are shown below. |
126 | 126 | # |
127 | 127 | # In theory, "uniform" colormaps should have *straight* lines in hue, chroma, |
|
168 | 168 | # |
169 | 169 | # * Pass a color name, HEX string, or RGB tuple to :class:`~ultraplot.constructor.Colormap`. |
170 | 170 | # This builds a monochromatic (single hue) colormap by calling |
171 | | -# `~ultraplot.colors.PerceptualColormap.from_color`. The colormap colors will |
| 171 | +# :func:`~ultraplot.colors.PerceptualColormap.from_color`. The colormap colors will |
172 | 172 | # progress from the specified color to a color with the same hue but changed |
173 | 173 | # saturation or luminance. These can be set with the `saturation` and `luminance` |
174 | 174 | # keywords (or their shorthands `s` and `l`). By default, the colormap will |
175 | 175 | # progress to pure white. |
176 | 176 | # * Pass a list of color names, HEX strings, or RGB |
177 | 177 | # tuples to :class:`~ultraplot.constructor.Colormap`. This calls |
178 | | -# `~ultraplot.colors.PerceptualColormap.from_list`, which linearly interpolates |
| 178 | +# :func:`~ultraplot.colors.PerceptualColormap.from_list`, which linearly interpolates |
179 | 179 | # between the hues, saturations, and luminances of the input colors. To facillitate |
180 | 180 | # the construction of diverging colormaps, the hue channel values for nuetral |
181 | 181 | # colors (i.e., white, black, and gray) are adjusted to the hues of the preceding |
|
184 | 184 | # * Pass the keywords `hue`, `saturation`, or `luminance` (or their shorthands `h`, |
185 | 185 | # `s`, and `l`) to :class:`~ultraplot.constructor.Colormap` without any positional arguments |
186 | 186 | # (or pass a dictionary containing these keys as a positional argument). |
187 | | -# This calls `~ultraplot.colors.PerceptualColormap.from_hsl`, which |
| 187 | +# This calls :func:`~ultraplot.colors.PerceptualColormap.from_hsl`, which |
188 | 188 | # linearly interpolates between the specified channel values. Channel values can be |
189 | 189 | # specified with numbers between ``0`` and ``100``, color strings, or lists thereof. |
190 | 190 | # For color strings, the value is *inferred* from the specified color. You can |
|
256 | 256 | # |
257 | 257 | # To *merge* colormaps, you can pass multiple positional arguments to the |
258 | 258 | # :class:`~ultraplot.constructor.Colormap` constructor function. This calls the |
259 | | -# `~ultraplot.colors.ContinuousColormap.append` method. Each positional |
| 259 | +# :func:`~ultraplot.colors.ContinuousColormap.append` method. Each positional |
260 | 260 | # argument can be a colormap name, a colormap instance, or a |
261 | 261 | # :ref:`special argument <ug_cmaps_new>` that generates a new colormap |
262 | 262 | # on-the-fly. This lets you create new diverging colormaps and segmented |
|
322 | 322 | # |
323 | 323 | # * To remove colors from the left or right ends of a colormap, pass `left` |
324 | 324 | # or `right` to :class:`~ultraplot.constructor.Colormap`. This calls the |
325 | | -# :method:`~ultraplot.colors.ContinuousColormap.truncate` method, and can be |
| 325 | +# :func:`~ultraplot.colors.ContinuousColormap.truncate` method, and can be |
326 | 326 | # useful when you want to use colormaps as :ref:`color cycles <ug_cycles>` |
327 | 327 | # and need to remove the light part so that your lines stand out |
328 | 328 | # against the background. |
329 | 329 | # * To modify the central colors of a diverging colormap, pass `cut` to |
330 | 330 | # :class:`~ultraplot.constructor.Colormap`. This calls the |
331 | | -# `~ultraplot.colors.ContinuousColormap.cut` method, and can be used |
| 331 | +# :func:`~ultraplot.colors.ContinuousColormap.cut` method, and can be used |
332 | 332 | # to create a sharper cutoff between negative and positive values or (when |
333 | 333 | # `cut` is negative) to expand the "neutral" region of the colormap. |
334 | 334 | # * To rotate a cyclic colormap, pass `shift` to |
335 | 335 | # :class:`~ultraplot.constructor.Colormap`. This calls the |
336 | | -# :property:`~ultraplot.colors.ContinuousColormap.shifted` method. UltraPlot ensures |
| 336 | +# :func:`~ultraplot.colors.ContinuousColormap.shifted` method. UltraPlot ensures |
337 | 337 | # the colors at the ends of "shifted" colormaps are *distinct* so that |
338 | 338 | # levels never blur together. |
339 | 339 | # * To change the opacity of a colormap or add an opacity *gradation*, pass |
340 | 340 | # `alpha` to :class:`~ultraplot.constructor.Colormap`. This calls the |
341 | | -# `~ultraplot.colors.ContinuousColormap.set_alpha` method, and can be |
| 341 | +# :func:`~ultraplot.colors.ContinuousColormap.set_alpha` method, and can be |
342 | 342 | # useful when *layering* filled contour or mesh elements. |
343 | 343 | # * To change the "gamma" of a :class:`~ultraplot.colors.PerceptualColormap`, |
344 | 344 | # pass `gamma` to :class:`~ultraplot.constructor.Colormap`. This calls the |
345 | | -# `~ultraplot.colors.PerceptualColormap.set_gamma` method, and |
| 345 | +# :func:`~ultraplot.colors.PerceptualColormap.set_gamma` method, and |
346 | 346 | # controls how the luminance and saturation channels vary between colormap |
347 | 347 | # segments. ``gamma > 1`` emphasizes high luminance, low saturation colors, |
348 | 348 | # while ``gamma < 1`` emphasizes low luminance, high saturation colors. This |
|
493 | 493 | # To add colormaps downloaded from any of these sources, save the color data file |
494 | 494 | # to the ``cmaps`` subfolder inside :func:`~ultraplot.config.Configurator.user_folder`, |
495 | 495 | # or to a folder named ``ultraplot_cmaps`` in the same directory as your python session |
496 | | -# or an arbitrary parent directory (see `~ultraplot.config.Configurator.local_folders`). |
| 496 | +# or an arbitrary parent directory (see :func:`~ultraplot.config.Configurator.local_folders`). |
497 | 497 | # After adding the file, call :func:`~ultraplot.config.register_cmaps` or restart your python |
498 | | -# session. You can also use `~ultraplot.colors.ContinuousColormap.from_file` or manually |
| 498 | +# session. You can also use :func:`~ultraplot.colors.ContinuousColormap.from_file` or manually |
499 | 499 | # pass :class:`~ultraplot.colors.ContinuousColormap` instances or file paths to |
500 | 500 | # :func:`~ultraplot.config.register_cmaps`. See :func:`~ultraplot.config.register_cmaps` |
501 | 501 | # for a table of recognized file extensions. |
0 commit comments