Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow control of marker size (and other aspects of plt.scatter) #78

Merged
merged 7 commits into from
Jan 31, 2023
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 = {},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be worth keeping s=10 and marker='o' as the defaults here? That way you have the same behaviour as before just with a little bit extra control?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

):
"""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 {}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you update the default value here too please?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, sorry about that. Done

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