Skip to content

Commit a9bad41

Browse files
committed
Remove size from slots
1 parent 21dcc91 commit a9bad41

3 files changed

Lines changed: 12 additions & 25 deletions

File tree

xarray_plotly/accessor.py

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,14 @@
22
Accessor classes for Plotly Express plotting on DataArray and Dataset.
33
"""
44

5-
from __future__ import annotations
5+
from typing import Any, ClassVar
66

7-
from typing import TYPE_CHECKING, Any, ClassVar
7+
import plotly.graph_objects as go
8+
from xarray import DataArray
89

910
from xarray_plotly import plotting
1011
from xarray_plotly.common import SlotValue, auto
1112

12-
if TYPE_CHECKING:
13-
import plotly.graph_objects as go
14-
from xarray import DataArray
15-
1613

1714
class DataArrayPlotlyAccessor:
1815
"""
@@ -201,7 +198,6 @@ def scatter(
201198
x: SlotValue = auto,
202199
y: SlotValue | str = "value",
203200
color: SlotValue = auto,
204-
size: SlotValue = auto,
205201
symbol: SlotValue = auto,
206202
facet_col: SlotValue = auto,
207203
facet_row: SlotValue = auto,
@@ -225,16 +221,14 @@ def scatter(
225221
color
226222
Dimension for color grouping. Default: second dimension.
227223
Use "value" to color by DataArray values (useful with y=dimension).
228-
size
229-
Dimension for marker size. Default: third dimension.
230224
symbol
231-
Dimension for marker symbol. Default: fourth dimension.
225+
Dimension for marker symbol. Default: third dimension.
232226
facet_col
233-
Dimension for subplot columns. Default: fifth dimension.
227+
Dimension for subplot columns. Default: fourth dimension.
234228
facet_row
235-
Dimension for subplot rows. Default: sixth dimension.
229+
Dimension for subplot rows. Default: fifth dimension.
236230
animation_frame
237-
Dimension for animation. Default: seventh dimension.
231+
Dimension for animation. Default: sixth dimension.
238232
**px_kwargs
239233
Additional arguments passed to `plotly.express.scatter()`.
240234
@@ -247,7 +241,6 @@ def scatter(
247241
x=x,
248242
y=y,
249243
color=color,
250-
size=size,
251244
symbol=symbol,
252245
facet_col=facet_col,
253246
facet_row=facet_row,

xarray_plotly/common.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ def __repr__(self) -> str:
5252
"scatter": (
5353
"x",
5454
"color",
55-
"size",
5655
"symbol",
5756
"facet_col",
5857
"facet_row",

xarray_plotly/plotting.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,6 @@ def scatter(
308308
x: SlotValue = auto,
309309
y: SlotValue | str = "value",
310310
color: SlotValue = auto,
311-
size: SlotValue = auto,
312311
symbol: SlotValue = auto,
313312
facet_col: SlotValue = auto,
314313
facet_row: SlotValue = auto,
@@ -322,7 +321,7 @@ def scatter(
322321
for dimension-vs-dimension plots (e.g., lat vs lon colored by value).
323322
324323
Dimensions fill slots in order:
325-
x -> color -> size -> symbol -> facet_col -> facet_row -> animation_frame
324+
x -> color -> symbol -> facet_col -> facet_row -> animation_frame
326325
327326
Parameters
328327
----------
@@ -336,16 +335,14 @@ def scatter(
336335
color
337336
Dimension for color grouping. Default: second dimension.
338337
Use "value" to color by DataArray values (useful with y=dimension).
339-
size
340-
Dimension for marker size. Default: third dimension.
341338
symbol
342-
Dimension for marker symbol. Default: fourth dimension.
339+
Dimension for marker symbol. Default: third dimension.
343340
facet_col
344-
Dimension for subplot columns. Default: fifth dimension.
341+
Dimension for subplot columns. Default: fourth dimension.
345342
facet_row
346-
Dimension for subplot rows. Default: sixth dimension.
343+
Dimension for subplot rows. Default: fifth dimension.
347344
animation_frame
348-
Dimension for animation. Default: seventh dimension.
345+
Dimension for animation. Default: sixth dimension.
349346
**px_kwargs
350347
Additional arguments passed to `plotly.express.scatter()`.
351348
@@ -362,7 +359,6 @@ def scatter(
362359
"scatter",
363360
x=x,
364361
color=color,
365-
size=size,
366362
symbol=symbol,
367363
facet_col=facet_col,
368364
facet_row=facet_row,
@@ -386,7 +382,6 @@ def scatter(
386382
x=slots.get("x"),
387383
y=y_col,
388384
color=color_col,
389-
size=slots.get("size"),
390385
symbol=slots.get("symbol"),
391386
facet_col=slots.get("facet_col"),
392387
facet_row=slots.get("facet_row"),

0 commit comments

Comments
 (0)