search in docstrings

Search bar offers the following options:

- Term presence. The below example searches for documents that must contain “foo”, might contain “bar” and must not contain “baz”: `+foo bar -baz`
- Wildcards. The below example searches for documents with words beginning with “foo”: `foo*`
- Search in specific fields. The following search matches all objects in "twisted.mail" that matches “search”: `+qname:twisted.mail.* +search`

  Possible fields: 'name', 'qname' (fully qualified name), 'docstring', and 'kind'. Last two fields are only applicable if "search in docstrings" is enabled.

- Fuzzy matches. The following search matches all documents that have a word within 1 edit distance of “foo”: `foo~1`

Results provided by Lunr.js

# ``igraph`.`drawing`.`colors`.`Palette``

class documentation

`class Palette: (source)`

Known subclasses: `igraph.drawing.colors.AdvancedGradientPalette`, `igraph.drawing.colors.GradientPalette`, `igraph.drawing.colors.PrecalculatedPalette`, `igraph.drawing.colors.RainbowPalette`

Constructor: `Palette(n)`

View In Hierarchy

Base class of color palettes.

Color palettes are mappings that assign integers from the range 0..n− 1 to colors (4-tuples). n is called the size or length of the palette. `igraph` comes with a number of predefined palettes, so this class is useful for you only if you want to define your own palette. This can be done by subclassing this class and implementing the `Palette._get` method as necessary.

Palettes can also be used as lists or dicts, for the `__getitem__` method is overridden properly to call `Palette.get`.

Method | `__init__` | Undocumented
Method | `__len__` | Returns the number of colors in this palette
Method | `__plot__` | Plots the colors of the palette on the given Cairo context/mpl Axes
Method | `__repr__` | Undocumented
Method | `clear_cache` | Clears the result cache.
Method | `get` | Returns the given color from the palette.
Method | `get_many` | Returns multiple colors from the palette.
Property | `length` | Returns the number of colors in this palette
Method | `_get` | Override this method in a subclass to create a custom palette.
Instance Variable | `_cache` | Undocumented
Instance Variable | `_length` | Undocumented

def __init__(self, n): (source)
overridden in `igraph.drawing.colors.AdvancedGradientPalette`, `igraph.drawing.colors.GradientPalette`, `igraph.drawing.colors.PrecalculatedPalette`, `igraph.drawing.colors.RainbowPalette`

Undocumented

def __len__(self): (source)

Returns the number of colors in this palette

def __plot__(self, backend, context, *args, **kwds): (source)

Plots the colors of the palette on the given Cairo context/mpl Axes

Supported keywork arguments in both Cairo and matplotlib are:

- `orientation`: the orientation of the palette. Must be one of the following values: `left-right`, `bottom-top`, `right-left` or `top-bottom`. Possible aliases: `horizontal` = `left-right`, `vertical` = `bottom-top`, `lr` = `left-right`, `rl` = `right-left`, `tb` = `top-bottom`, `bt` = `bottom-top`. The default is `left-right`.

Additional supported keyword arguments in Cairo are:

- `border_width`: line width of the border shown around the palette. If zero or negative, the border is turned off. Default is `1`.
- `grid_width`: line width of the grid that separates palette cells. If zero or negative, the grid is turned off. The grid is also turned off if the size of a cell is less than three times the given line width. Default is `0`. Fractional widths are also allowed.

Keyword arguments in matplotlib are passes to Axes.imshow.

def __repr__(self): (source)

Undocumented

def clear_cache(self): (source)

Clears the result cache.

The return values of `Palette.get` are cached. Use this method to clear the cache.

def get(self, v): (source)

Returns the given color from the palette.

Values are cached: if the specific value given has already been looked up, its value will be returned from the cache instead of calculating it again. Use `Palette.clear_cache` to clear the cache if necessary.

Parameters
v | the color to be retrieved. If it is an integer, it is passed to `Palette._get` to be translated to an RGBA quadruplet. Otherwise it is passed to `color_name_to_rgb()` to determine the RGBA values.
Returns
the color as an RGBA quadruplet
Note
you shouldn't override this method in subclasses, override `_get` instead. If you override this method, lookups in the `known_colors` dict won't work, so you won't be able to refer to colors by names or RGBA quadruplets, only by integer indices. The caching functionality will disappear as well. However, feel free to override this method if this is exactly the behaviour you want.

def get_many(self, colors): (source)

Returns multiple colors from the palette.

Values are cached: if the specific value given has already been looked upon, its value will be returned from the cache instead of calculating it again. Use `Palette.clear_cache` to clear the cache if necessary.

Parameters
colors | the list of colors to be retrieved. The palette class tries to make an educated guess here: if it is not possible to interpret the value you passed here as a list of colors, the class will simply try to interpret it as a single color by forwarding the value to `Palette.get`.
Returns
the colors as a list of RGBA quadruplets. The result will be a list even if you passed a single color index or color name.

@property
length = (source)

Returns the number of colors in this palette

@abstractmethod
def _get(self, v): (source)
overridden in `igraph.drawing.colors.AdvancedGradientPalette`, `igraph.drawing.colors.GradientPalette`, `igraph.drawing.colors.PrecalculatedPalette`, `igraph.drawing.colors.RainbowPalette`

Override this method in a subclass to create a custom palette.

You can safely assume that v is an integer in the range 0..n− 1 where n is the size of the palette.

Parameters
v | numerical index of the color to be retrieved
Returns
a 4-tuple containing the RGBA values

_cache: `dict` = (source)

Undocumented

_length = (source)

Undocumented