Skip to content

Commit

Permalink
DOC improve docstring of add_marginal_subplot (#193)
Browse files Browse the repository at this point in the history
  • Loading branch information
lorentzenchr authored Nov 28, 2024
1 parent 673cd55 commit c84db50
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/model_diagnostics/calibration/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -1223,12 +1223,12 @@ def model_predict(X):
def add_marginal_subplot(subfig, fig, row: int, col: int):
"""Add a plotly subplot from plot_marginal to a multi-plot figure.
This is a helper function is accompanying
This auxiliary function is accompanies
[`plot_marginal`][model_diagnostics.calibration.plot_marginal] in order to ease
plotting with subfigures with the plotly backend.
For it to work, you must call `make_subplots` with the `specs` argument and set
the appropriate number of `{"secondary_y": True}` in a list of lists.
For it to work, you must call plotly's `make_subplots` with the `specs` argument
and set the appropriate number of `{"secondary_y": True}` in a list of lists.
```py hl_lines="7"
from plotly.subplots import make_subplots
Expand Down Expand Up @@ -1256,6 +1256,7 @@ def add_marginal_subplot(subfig, fig, row: int, col: int):
Returns
-------
fig
The plotly figure `fig`.
"""
# It returns a tuple of `range`s starting at 1.
plotly_rows, plotly_cols = fig._get_subplot_rows_columns() # noqa: SLF001
Expand Down

0 comments on commit c84db50

Please sign in to comment.