Skip to content

Commit

Permalink
Fix butted path joins for geoms that use geom_path
Browse files Browse the repository at this point in the history
  • Loading branch information
has2k1 committed May 12, 2017
1 parent a9ed09b commit a397831
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ clean-test:
rm -fr .tox/
rm -f .coverage
rm -fr htmlcov/
rm -fr result_images/*

lint:
flake8 plotnine
Expand Down
4 changes: 4 additions & 0 deletions doc/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ v0.1.1
- Fixed exceptions when using :func:`pandas.pivot_table` for Pandas v0.20.0.
The API was `fixed <http://pandas.pydata.org/pandas-docs/version/0.20/whatsnew.html#pivot-table-always-returns-a-dataframe>`_.

- Fixed issues where lines/paths with segments that all belonged in the
same group had joins that in some cases were "butted".


API Changes
***********

Expand Down
4 changes: 2 additions & 2 deletions plotnine/geoms/geom_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def draw_panel(self, data, panel_params, coord, ax, **params):
cols = {'color', 'size', 'linetype', 'alpha', 'group'}
cols = cols & set(data.columns)
df = data.drop_duplicates(cols)
constant = len(df) == len(data['group'].unique())
constant = len(df) == data['group'].nunique()
params['constant'] = constant

if not constant:
Expand All @@ -117,7 +117,7 @@ def draw_panel(self, data, panel_params, coord, ax, **params):
def draw_group(data, panel_params, coord, ax, **params):
data = coord.transform(data, panel_params, munch=True)
data['size'] *= SIZE_FACTOR
constant = params.pop('constant', False)
constant = params.pop('constant', data['group'].nunique() == 1)

if not constant:
_draw_segments(data, ax, **params)
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified plotnine/tests/baseline_images/test_geom_path_line_step/step.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified plotnine/tests/baseline_images/test_stat_ecdf/ecdf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a397831

Please sign in to comment.