Skip to content

Commit

Permalink
Rename Interval mark to Range for brevity
Browse files Browse the repository at this point in the history
  • Loading branch information
mwaskom committed Aug 8, 2022
1 parent f728e94 commit 4438bb4
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
6 changes: 3 additions & 3 deletions doc/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ Mark objects
Bars
Dot
Dots
Interval
Path
Paths
Line
Lines
Path
Paths
Range

Stat objects
~~~~~~~~~~~~
Expand Down
4 changes: 3 additions & 1 deletion doc/nextgen/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,14 @@ Marks
Area
Band
Bar
Bars
Dot
Dots
Line
Lines
Path
Paths
Scatter
Range

Stats
-----
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
2 changes: 1 addition & 1 deletion seaborn/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
from seaborn._marks.base import Mark # 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
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

0 comments on commit 4438bb4

Please sign in to comment.