Skip to content

Commit

Permalink
Fix mapping and data args in geom_text
Browse files Browse the repository at this point in the history
fixes #449
  • Loading branch information
has2k1 committed Oct 20, 2020
1 parent 7398758 commit 7189c79
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions doc/changelog.rst
Expand Up @@ -13,6 +13,9 @@ Bug Fixes

- Fixed :class:`~plotnine.geoms.geom_map` to plot ``MultiLineString`` geom types.

- Fixed :class:`~plotnine.geoms.geom_text` to allow any order of ``mapping`` and
``data`` positional arguments.

Enhancements
************
- Manual scales now match the values of the breaks if the breaks are given.
Expand Down
3 changes: 2 additions & 1 deletion plotnine/geoms/geom_text.py
Expand Up @@ -9,7 +9,7 @@
else:
HAS_ADJUST_TEXT = True

from ..utils import to_rgba
from ..utils import to_rgba, order_as_mapping_data
from ..doctools import document
from ..positions import position_nudge
from ..exceptions import PlotnineError
Expand Down Expand Up @@ -87,6 +87,7 @@ class geom_text(geom):
'path_effects': None}

def __init__(self, mapping=None, data=None, **kwargs):
mapping, data = order_as_mapping_data(mapping, data)
nudge_kwargs = {}
adjust_text = kwargs.get('adjust_text', None)
if adjust_text is None:
Expand Down

0 comments on commit 7189c79

Please sign in to comment.