Skip to content

Commit

Permalink
Merge pull request #15 from mitlabence/master
Browse files Browse the repository at this point in the history
Added radius (r) as supported parameter for the scatter() functions
  • Loading branch information
henrysky committed Jan 2, 2024
2 parents bad5916 + 0150111 commit 49cd216
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions mw_plot/mw_plot_bokeh.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ def __init__(
def scatter(self, x, y, *args, **kwargs):
x, y = self.xy_unit_check(x, y)
if kwargs.get("s") is None:
# Only one of radius or size should be passed to bokeh circle. Size is prioritized.
if kwargs.get("r") is not None:
self.bokeh_fig.circle(x, y, radius=kwargs["r"])
return
kwargs["s"] = self.s
self.bokeh_fig.circle(x, y, size=self.s)

Expand Down Expand Up @@ -261,6 +265,10 @@ def __init__(
def scatter(self, ra, dec, *args, **kwargs):
ra, dec = self.radec_unit_check(ra, dec)
if kwargs.get("s") is None:
# Only one of radius or size should be passed to bokeh circle. Size is prioritized.
if kwargs.get("r") is not None:
self.bokeh_fig.circle(ra, dec, radius=kwargs["r"])
return
kwargs["s"] = self.s
self.bokeh_fig.circle(ra, dec, size=self.s)

Expand Down

0 comments on commit 49cd216

Please sign in to comment.