Skip to content

Commit

Permalink
Fix geom_ribbon upper outline
Browse files Browse the repository at this point in the history
fixes #728
  • Loading branch information
has2k1 committed Jan 4, 2024
1 parent 3e1af2a commit ab5bda0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions doc/changelog.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ title: Changelog
- Fixed using legend when using an identity scale and reordering the
breaks. ({{< issue 735 >}})

- Fixed drawing the upper outline of `geom_ribbon`. ({{< issue 728 >}})

### Enhancements

- All `__all__` variables are explicitly assigned to help static typecheckers
Expand Down
7 changes: 4 additions & 3 deletions plotnine/geoms/geom_ribbon.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,7 @@ def _draw_outline(
if outline_type == "full":
return

x = "x"
y = "y"
x, y = "x", "y"
if isinstance(coord, coord_flip):
x, y = y, x
data[x], data[y] = data[y], data[x]
Expand All @@ -184,4 +183,6 @@ def _draw_outline(
)

if outline_type in ("upper", "both"):
geom_path.draw_group(data, panel_params, coord, ax, **params)
geom_path.draw_group(
data.eval(f"y = {y}max"), panel_params, coord, ax, **params
)

0 comments on commit ab5bda0

Please sign in to comment.