Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed ax.plot to ax.scatter #2069

Merged
merged 6 commits into from
Jul 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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