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

Renaming: Ribbon -> Band, Interval -> Range #2945

Merged
merged 2 commits into from
Aug 13, 2022
Merged
Show file tree
Hide file tree
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
8 changes: 4 additions & 4 deletions doc/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ Mark objects
:nosignatures:

Area
Band
Bar
Bars
Dot
Dots
Interval
Path
Paths
Line
Lines
Ribbon
Path
Paths
Range

Stat objects
~~~~~~~~~~~~
Expand Down
6 changes: 4 additions & 2 deletions doc/nextgen/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,16 @@ Marks
:nosignatures:

Area
Band
Bar
Bars
Dot
Dots
Line
Lines
Path
Paths
Ribbon
Scatter
Range

Stats
-----
Expand Down
2 changes: 1 addition & 1 deletion doc/nextgen/demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@
" .describe()\n",
" .pipe(so.Plot, x=\"timepoint\")\n",
" .add(so.Line(), y=\"mean\")\n",
" .add(so.Ribbon(alpha=.2), ymin=\"min\", ymax=\"max\")\n",
" .add(so.Band(alpha=.2), ymin=\"min\", ymax=\"max\")\n",
")"
]
},
Expand Down
2 changes: 1 addition & 1 deletion seaborn/_marks/area.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def _postprocess_artist(self, artist, ax, orient):


@dataclass
class Ribbon(AreaBase, Mark):
class Band(AreaBase, Mark):
"""
An interval mark that fills between minimum and maximum values.
"""
Expand Down
2 changes: 1 addition & 1 deletion seaborn/_marks/line.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ class Lines(Paths):


@dataclass
class Interval(Paths):
class Range(Paths):
"""
An oriented line mark drawn between min/max values.
"""
Expand Down
4 changes: 2 additions & 2 deletions seaborn/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
from seaborn._core.plot import Plot # noqa: F401

from seaborn._marks.base import Mark # noqa: F401
from seaborn._marks.area import Area, Ribbon # noqa: F401
from seaborn._marks.area import Area, Band # noqa: F401
from seaborn._marks.bar import Bar, Bars # noqa: F401
from seaborn._marks.line import Line, Lines, Path, Paths, Interval # noqa: F401
from seaborn._marks.line import Line, Lines, Path, Paths, Range # noqa: F401
from seaborn._marks.dot import Dot, Dots # noqa: F401

from seaborn._stats.base import Stat # noqa: F401
Expand Down
6 changes: 3 additions & 3 deletions tests/_marks/test_area.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from numpy.testing import assert_array_equal

from seaborn._core.plot import Plot
from seaborn._marks.area import Area, Ribbon
from seaborn._marks.area import Area, Band


class TestAreaMarks:
Expand Down Expand Up @@ -94,10 +94,10 @@ def test_unfilled(self):
poly = ax.patches[0]
assert poly.get_facecolor() == to_rgba("C0", 0)

def test_ribbon(self):
def test_band(self):

x, ymin, ymax = [1, 2, 4], [2, 1, 4], [3, 3, 5]
p = Plot(x=x, ymin=ymin, ymax=ymax).add(Ribbon()).plot()
p = Plot(x=x, ymin=ymin, ymax=ymax).add(Band()).plot()
ax = p._figure.axes[0]
verts = ax.patches[0].get_path().vertices.T

Expand Down
10 changes: 5 additions & 5 deletions tests/_marks/test_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from numpy.testing import assert_array_equal

from seaborn._core.plot import Plot
from seaborn._marks.line import Line, Path, Lines, Paths, Interval
from seaborn._marks.line import Line, Path, Lines, Paths, Range


class TestPath:
Expand Down Expand Up @@ -244,15 +244,15 @@ def test_xy_data(self):
assert_array_equal(verts[1], [3, 4])


class TestInterval:
class TestRange:

def test_xy_data(self):

x = [1, 2]
ymin = [1, 4]
ymax = [2, 3]

p = Plot(x=x, ymin=ymin, ymax=ymax).add(Interval()).plot()
p = Plot(x=x, ymin=ymin, ymax=ymax).add(Range()).plot()
lines, = p._figure.axes[0].collections

for i, path in enumerate(lines.get_paths()):
Expand All @@ -267,7 +267,7 @@ def test_mapped_color(self):
ymax = [2, 3, 1, 4]
group = ["a", "a", "b", "b"]

p = Plot(x=x, ymin=ymin, ymax=ymax, color=group).add(Interval()).plot()
p = Plot(x=x, ymin=ymin, ymax=ymax, color=group).add(Range()).plot()
lines, = p._figure.axes[0].collections

for i, path in enumerate(lines.get_paths()):
Expand All @@ -282,7 +282,7 @@ def test_direct_properties(self):
ymin = [1, 4]
ymax = [2, 3]

m = Interval(color="r", linewidth=4)
m = Range(color="r", linewidth=4)
p = Plot(x=x, ymin=ymin, ymax=ymax).add(m).plot()
lines, = p._figure.axes[0].collections

Expand Down