From d61efb6a2558fe69a5445459c179b6a77f169b61 Mon Sep 17 00:00:00 2001 From: Tattvam Shah <73391843+tattvams@users.noreply.github.com> Date: Tue, 1 Mar 2022 20:31:35 +0530 Subject: [PATCH 1/5] ax.plot -> ax.scatter if scatter in kind --- arviz/plots/backends/matplotlib/pairplot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arviz/plots/backends/matplotlib/pairplot.py b/arviz/plots/backends/matplotlib/pairplot.py index 5090602a31..8bf65e6c5d 100644 --- a/arviz/plots/backends/matplotlib/pairplot.py +++ b/arviz/plots/backends/matplotlib/pairplot.py @@ -173,7 +173,7 @@ def plot_pair( ax = np.atleast_2d(ax)[0, 0] if "scatter" in kind: - ax.plot(x, y, **scatter_kwargs) + ax.scatter(x, y, **scatter_kwargs) if "kde" in kind: plot_kde(x, y, ax=ax, **kde_kwargs) if "hexbin" in kind: From 023af5202dac2b09b20923a3045bacc5caf7ce31 Mon Sep 17 00:00:00 2001 From: Tattvam Shah <73391843+tattvams@users.noreply.github.com> Date: Tue, 1 Mar 2022 21:12:28 +0530 Subject: [PATCH 2/5] plot -> scatter --- arviz/plots/backends/matplotlib/pairplot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arviz/plots/backends/matplotlib/pairplot.py b/arviz/plots/backends/matplotlib/pairplot.py index 8bf65e6c5d..2b5c481dcd 100644 --- a/arviz/plots/backends/matplotlib/pairplot.py +++ b/arviz/plots/backends/matplotlib/pairplot.py @@ -288,7 +288,7 @@ def plot_pair( loc = "left" if "scatter" in kind: - ax[j, i].plot(var1, var2, **scatter_kwargs) + ax[j, i].scatter(var1, var2, **scatter_kwargs) if "kde" in kind: From e003ff27be38b2b625b81773ba7a394c6dc23fab Mon Sep 17 00:00:00 2001 From: Agustina Arroyuelo Date: Sat, 25 Jun 2022 11:49:36 -0300 Subject: [PATCH 3/5] updated changelog and documentation --- CHANGELOG.md | 1 + arviz/plots/pairplot.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 60472a4f81..746a041ce7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -58,6 +58,7 @@ * Fix coord value ignoring for default dims ([2001](https://github.com/arviz-devs/arviz/pull/2001)) * Fixed plot_posterior with boolean data ([1707](https://github.com/arviz-devs/arviz/pull/1707)) * Fix min_ess usage in plot_ess ([2002](https://github.com/arviz-devs/arviz/pull/2002)) +* Change `ax.plot` usage to `ax.scatter` in `plot_pair`. ([1990](https://github.com/arviz-devs/arviz/pull/1990)) ### Deprecation diff --git a/arviz/plots/pairplot.py b/arviz/plots/pairplot.py index cbbf2f1653..4969fad6a7 100644 --- a/arviz/plots/pairplot.py +++ b/arviz/plots/pairplot.py @@ -101,7 +101,7 @@ def plot_pair( divergences_kwargs: dicts, optional Additional keywords passed to :meth:`matplotlib.axes.Axes.scatter` for divergences scatter_kwargs: - Additional keywords passed to :meth:`matplotlib.axes.Axes.plot` when using scatter kind + Additional keywords passed to :meth:`matplotlib.axes.Axes.scatter` when using scatter kind kde_kwargs: dict, optional Additional keywords passed to :func:`arviz.plot_kde` when using kde kind hexbin_kwargs: dict, optional From fd1600d315fe1531c3591769d5dc032ed70c000f Mon Sep 17 00:00:00 2001 From: Agustina Arroyuelo Date: Fri, 1 Jul 2022 20:37:15 -0300 Subject: [PATCH 4/5] updated test for plot_pair --- arviz/tests/base_tests/test_plots_matplotlib.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arviz/tests/base_tests/test_plots_matplotlib.py b/arviz/tests/base_tests/test_plots_matplotlib.py index 8752c5564a..c9326ca6a1 100644 --- a/arviz/tests/base_tests/test_plots_matplotlib.py +++ b/arviz/tests/base_tests/test_plots_matplotlib.py @@ -555,12 +555,12 @@ def test_plot_kde_inference_data(models): "var_names": "theta", "divergences": True, "coords": {"school": [0, 1]}, - "scatter_kwargs": {"marker": "x"}, + "scatter_kwargs": {"marker": "x", "c": "C0"}, "divergences_kwargs": {"marker": "*", "c": "C0"}, }, { "divergences": True, - "scatter_kwargs": {"marker": "x"}, + "scatter_kwargs": {"marker": "x", "c": "C0"}, "divergences_kwargs": {"marker": "*", "c": "C0"}, "var_names": ["theta", "mu"], }, From 542ad41640f544a8efdd77f5f8b99584f71c4f9d Mon Sep 17 00:00:00 2001 From: Agustina Arroyuelo Date: Sat, 2 Jul 2022 12:17:57 -0300 Subject: [PATCH 5/5] fixed changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 746a041ce7..f71cb87f2b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### New features ### Maintenance and fixes +* Change `ax.plot` usage to `ax.scatter` in `plot_pair`. ([1990](https://github.com/arviz-devs/arviz/pull/1990)) ### Deprecation @@ -58,7 +59,6 @@ * Fix coord value ignoring for default dims ([2001](https://github.com/arviz-devs/arviz/pull/2001)) * Fixed plot_posterior with boolean data ([1707](https://github.com/arviz-devs/arviz/pull/1707)) * Fix min_ess usage in plot_ess ([2002](https://github.com/arviz-devs/arviz/pull/2002)) -* Change `ax.plot` usage to `ax.scatter` in `plot_pair`. ([1990](https://github.com/arviz-devs/arviz/pull/1990)) ### Deprecation