Skip to content

Commit

Permalink
Allow control of marker size (and other aspects of plt.scatter) (#78)
Browse files Browse the repository at this point in the history
* allow control of marker size

* allow data_label_filter arg

* Revert "allow data_label_filter arg"

This reverts commit 2764be6.

* remove marker size arg, replace with scatter_kwargs

* add default args

* add default args to docs
  • Loading branch information
zhang-ivy authored Jan 31, 2023
1 parent 86e5eda commit 0f10e11
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cinnabar/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def _master_plot(
bootstrap_x_uncertainty: bool = False,
bootstrap_y_uncertainty: bool = False,
statistic_type: str = "mle",
scatter_kwargs: dict = {"s": 10, "marker": "o"},
):
"""Handles the aesthetics of the plots in one place.
Expand Down Expand Up @@ -97,6 +98,8 @@ def _master_plot(
statistic_type : str, default 'mle'
the type of statistic to use, either 'mle' (i.e. sample statistic)
or 'mean' (i.e. bootstrapped mean statistic)
scatter_kwargs : dict, default {"s": 10, "marker": "o"}
arguments to control plt.scatter()
Returns
-------
Expand Down Expand Up @@ -166,7 +169,7 @@ def _master_plot(
elinewidth=2.0,
zorder=1,
)
plt.scatter(x, y, color=color, s=10, marker="o", zorder=2)
plt.scatter(x, y, color=color, zorder=2, **scatter_kwargs)

# Label points
texts = []
Expand Down

0 comments on commit 0f10e11

Please sign in to comment.