currentscape.legends¶
Legends related functions.
Functions
|
Returns a legend with all current names. |
Return handles as a list of tuples (patch, line). |
|
|
Set each current name color-coded in legend. |
|
Create legend and color each current name, and set handles color and pattern. |
Create legend and color each current name, and set handles color and pattern. |
|
|
Create legend and color each current name, and set handles color and pattern. |
- currentscape.legends.base_legend(ax, curr_names, bg_color, ypos, idx_names=None, handlelength=None, lines=False)[source]¶
Returns a legend with all current names.
- Parameters:
ax (matplotlib.axes) – currentscape axis
curr_names (list of str) – legend labels / current names
bg_color (color) – background color for legend box
ypos (float) – y-axis position of legend box. 1 is top of axis.
idx_names (ndarray of ints) – indexes to new name order (new_names = names[idx_names])
handlelength (float) – size of the handles. Takes default value if None. No handles displayed if 0.
lines (bool) – if True, get lines as handles. if False, get patches as handles.
- currentscape.legends.get_handles_with_hatches_and_linestyles(c, cmap, mapper, N_curr)[source]¶
Return handles as a list of tuples (patch, line).
With patch showing color and hatch and line showing the linestyle.
- Parameters:
c (dict) – config
cmap (matplotlib.colors.Colormap) – colormap
mapper (int) – number used to mix color and patterns
N_curr (int) – number of currents
- currentscape.legends.set_legend(ax, cmap, curr_names, bg_color, ypos, idx_names=None, handlelength=0)[source]¶
Set each current name color-coded in legend.
- Parameters:
ax (matplotlib.axes) – currentscape axis
cmap (matplotlib.colors.Colormap) – colormap
curr_names (list of str) – legend labels / current names
bg_color (color) – background color for legend box
ypos (float) – y-axis position of legend box. 1 is top of axis.
idx_names (ndarray of ints) – indexes to new name order (new_names = names[idx_names])
handlelength (float) – size of the handles. Takes default value if None. No handles displayed if 0.
- currentscape.legends.set_legend_with_hatches(ax, cmap, mapper, c, idx_names)[source]¶
Create legend and color each current name, and set handles color and pattern.
- Parameters:
ax (matplotlib.axes) – currentscape axis
cmap (matplotlib.colors.Colormap) – colormap
mapper (int) – number used to mix color and patterns
c (dict) – config
idx_names (ndarray of ints) – indexes to new name order (new_names = names[idx_names])
- currentscape.legends.set_legend_with_hatches_and_linestyles(ax, cmap, mapper, c, idx_names)[source]¶
Create legend and color each current name, and set handles color and pattern.
- Parameters:
ax (matplotlib.axes) – currentscape axis
cmap (matplotlib.colors.Colormap) – colormap
mapper (int) – number used to mix color and patterns
c (dict) – config
idx_names (ndarray of ints) – indexes to new name order (new_names = names[idx_names])
- currentscape.legends.set_legend_with_lines(ax, cmap, mapper, c, idx_names, names)[source]¶
Create legend and color each current name, and set handles color and pattern.
- Parameters:
ax (matplotlib.axes) – currentscape axis
cmap (matplotlib.colors.Colormap) – colormap
mapper (int) – number used to mix color and patterns
c (dict) – config
idx_names (ndarray of ints) – indexes to new name order (new_names = names[idx_names])
names (list of str) – legend labels