Skip to content

Commit a997859

Browse files
committed
Add c_label parameter to get_scatter2d and adjust margin settings
1 parent 97dda72 commit a997859

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

viz/viz.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ def get_scatter2d(
171171
c_key: str,
172172
x_label: Optional[str] = None,
173173
y_label: Optional[str] = None,
174+
c_label: Optional[str] = None,
174175
uirevision: str = "no_change",
175176
colormap: str = "Jet",
176177
margin: Optional[Dict[str, int]] = None,
@@ -200,15 +201,16 @@ def get_scatter2d(
200201
linewidth = kwargs.get("linewidth", 0)
201202

202203
if margin is None:
203-
margin = {"l": 80, "r": 40, "b": 40, "t": 60}
204+
margin = {"l": 70, "r": 60, "b": 60, "t": 60}
204205

205206
if x_label is None:
206207
x_label = x_key
207208

208209
if y_label is None:
209210
y_label = y_key
210211

211-
c_label = kwargs.get("c_label", c_key)
212+
if c_label is None:
213+
c_label = c_key
212214
c_type = kwargs.get("c_type", "numerical")
213215

214216
if c_type == "numerical":
@@ -226,7 +228,7 @@ def get_scatter2d(
226228
"colorscale": colormap,
227229
"opacity": 0.8,
228230
"colorbar": {
229-
"title": c_label,
231+
"title": {"text": c_label, "side": "right"},
230232
},
231233
"line": {
232234
"color": "#FFFFFF",

0 commit comments

Comments
 (0)