Skip to content
Open
Changes from all 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
29 changes: 29 additions & 0 deletions tests/plotting/scatter_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,35 @@ def test_scatter_two_inputs():
pp.scatter({'a': a, 'b': b})


def test_scatter_multi_input_ylabel_drops_name():
a = pp.data.scatter()
b = pp.data.scatter(seed=2) * 10.0
b.coords['x'] += sc.scalar(50.0, unit='m')

fig = pp.scatter({'a': a, 'b': b})
assert fig.canvas.ylabel == '[K]'
Copy link
Member

Choose a reason for hiding this comment

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

Why is the label [K]? Shouldn't it be y [m]?
I think K is the units of the data, not the xy coords?



def test_scatter_multi_input_non_xy_dims_ylabel_drops_name():
a = sc.DataArray(
data=sc.linspace('point', 0.0, 4.0, 5, unit='K'),
coords={
'u': sc.linspace('point', 0.0, 4.0, 5, unit='m'),
'v': sc.linspace('point', -2.0, 2.0, 5, unit='m'),
},
)
b = sc.DataArray(
data=sc.linspace('point', 1.0, 5.0, 5, unit='K'),
coords={
'u': sc.linspace('point', 10.0, 14.0, 5, unit='m'),
'v': sc.linspace('point', -2.0, 2.0, 5, unit='m'),
},
)

fig = pp.scatter({'a': a, 'b': b}, x='u', y='v')
assert fig.canvas.ylabel == '[K]'


def test_scatter_two_inputs_color():
a = scatter_data()
b = scatter_data(seed=2) * 10.0
Expand Down