Skip to content

Commit a3a551d

Browse files
AlFontalhas2k1
authored andcommitted
test: add regression test for arrow distortion in coord_flip
1 parent f9da410 commit a3a551d

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed
13.7 KB
Loading

tests/test_geom_segment.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import pandas as pd
22

3-
from plotnine import aes, arrow, geom_segment, ggplot
3+
from plotnine import aes, arrow, coord_flip, geom_segment, ggplot
44

55
n = 4
66

@@ -46,3 +46,19 @@ def test_arrow():
4646
)
4747

4848
assert p == "arrow"
49+
50+
51+
def test_arrow_coord_flip():
52+
p = (
53+
ggplot(data, aes("x", "y", xend="xend", yend="yend"))
54+
+ geom_segment(aes("x+2", xend="xend+2"), arrow=arrow(), size=2)
55+
+ geom_segment(
56+
aes("x+4", xend="xend+4"), arrow=arrow(ends="first"), size=2
57+
)
58+
+ geom_segment(
59+
aes("x+6", xend="xend+6"), arrow=arrow(ends="both"), size=2
60+
)
61+
+ coord_flip()
62+
)
63+
64+
assert p == "arrow_coord_flip"

0 commit comments

Comments
 (0)