Skip to content

Commit

Permalink
Changed ax.plot to ax.scatter (#2069)
Browse files Browse the repository at this point in the history
* ax.plot -> ax.scatter if scatter in kind

* plot -> scatter

* updated changelog and documentation

* updated test for plot_pair

* fixed changelog

Co-authored-by: Tattvam Shah <73391843+tattvams@users.noreply.github.com>
  • Loading branch information
agustinaarroyuelo and tattvams authored Jul 15, 2022
1 parent 101a0f6 commit 86c2b97
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

### Maintenance and fixes
* Add exception in `az.plot_hdi` for `x` of type `np.datetime64` and `smooth=True` ([2016](https://github.com/arviz-devs/arviz/pull/2016))
* Change `ax.plot` usage to `ax.scatter` in `plot_pair`. ([1990](https://github.com/arviz-devs/arviz/pull/1990))

### Deprecation

Expand Down
4 changes: 2 additions & 2 deletions arviz/plots/backends/matplotlib/pairplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:

Expand Down
2 changes: 1 addition & 1 deletion arviz/plots/pairplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions arviz/tests/base_tests/test_plots_matplotlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
},
Expand Down

0 comments on commit 86c2b97

Please sign in to comment.