diff --git a/Makefile b/Makefile index e17ddd2bf..ab718678d 100644 --- a/Makefile +++ b/Makefile @@ -35,6 +35,7 @@ clean-test: rm -fr .tox/ rm -f .coverage rm -fr htmlcov/ + rm -fr result_images/* lint: flake8 plotnine diff --git a/doc/changelog.rst b/doc/changelog.rst index 3f309f83e..74658df32 100644 --- a/doc/changelog.rst +++ b/doc/changelog.rst @@ -14,6 +14,10 @@ v0.1.1 - Fixed exceptions when using :func:`pandas.pivot_table` for Pandas v0.20.0. The API was `fixed `_. +- Fixed issues where lines/paths with segments that all belonged in the + same group had joins that in some cases were "butted". + + API Changes *********** diff --git a/plotnine/geoms/geom_path.py b/plotnine/geoms/geom_path.py index 41642b101..bbd26c575 100644 --- a/plotnine/geoms/geom_path.py +++ b/plotnine/geoms/geom_path.py @@ -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: @@ -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) diff --git a/plotnine/tests/baseline_images/test_geom_path_line_step/path_line_step.png b/plotnine/tests/baseline_images/test_geom_path_line_step/path_line_step.png index 561dfd50d..88c610dee 100644 Binary files a/plotnine/tests/baseline_images/test_geom_path_line_step/path_line_step.png and b/plotnine/tests/baseline_images/test_geom_path_line_step/path_line_step.png differ diff --git a/plotnine/tests/baseline_images/test_geom_path_line_step/step.png b/plotnine/tests/baseline_images/test_geom_path_line_step/step.png index 93559e166..be3ee3674 100644 Binary files a/plotnine/tests/baseline_images/test_geom_path_line_step/step.png and b/plotnine/tests/baseline_images/test_geom_path_line_step/step.png differ diff --git a/plotnine/tests/baseline_images/test_stat_ecdf/ecdf.png b/plotnine/tests/baseline_images/test_stat_ecdf/ecdf.png index f059c0a15..ecd30a0e0 100644 Binary files a/plotnine/tests/baseline_images/test_stat_ecdf/ecdf.png and b/plotnine/tests/baseline_images/test_stat_ecdf/ecdf.png differ