Get line specifications

plot_utils.get_linespecs(color_scheme='tab10', n_linestyle=4, range_linewidth=[1, 2, 3], priority='color')[source]

Return a list of distinguishable line specifications (color, line style, and line width combinations).

Parameters:
  • color_scheme (str or {8.3, 8.4}) – Color scheme specifier. See documentation of get_colors() for valid specifiers.

  • n_linestyle ({1, 2, 3, 4}) – Number of different line styles to use. There are only four available line stylies in Matplotlib: (1) - (2) – (3) -. and (4) .. For example, if you use 2, you choose only - and –

  • range_linewidth (list, numpy.ndarray, or pandas.Series) – The range of different line width values to use.

  • priority ({'color', 'linestyle', 'linewidth'}) – Which one of the three line specification aspects (i.e., color, line style, or line width) should change first in the resulting list of line specifications.

Returns:

style_cycle_list

A list whose every element is a dictionary that looks like this:

{‘color’: ‘#1f77b4’, ‘ls’: ‘-’, ‘lw’: 1}.

Each element can then be passed as keyword arguments to matplotlib.pyplot.plot() or other similar functions.

Return type:

list<dict>

Example

>>> import plot_utils as pu
>>> import matplotlib.pyplot as plt
>>> plt.plot([0,1], [0,1], **pu.get_linespecs()[53])