Skip to content

Commit

Permalink
Add colorpatch legend (3)
Browse files Browse the repository at this point in the history
Update API reference
  • Loading branch information
dostuffthatmatters committed Sep 1, 2024
1 parent e9bcf24 commit d1dd4ef
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions docs/pages/api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,31 @@ Add a subplot to a figure.
- `ValueError` - If the index of the subplot is invalid.


##### `add_colorpatch_legend`

```python
def add_colorpatch_legend(fig: plt.Figure,
handles: List[Tuple[str, Union[
str,
Tuple[float, float, float],
Tuple[float, float, float, float],
]]],
ncols: Optional[int] = None,
location: str = "upper left") -> None
```

Add a color patch legend to a figure.

**Arguments**:

- `fig` - The figure to add the legend to.
- `handles` - A list of tuples containing the label and color of each patch
(e.g. `[("Label 1", "red"), ("Label 2", "blue")]`). You can pass any color
that is accepted by matplotlib.
- `ncols` - The number of columns in the legend.
- `location` - The location of the legend.


## `tum_esm_utils.processes`

Functions to start and terminate background processes.
Expand Down

0 comments on commit d1dd4ef

Please sign in to comment.