Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

TST: fix some mpl warnings #38574

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

Merged
merged 6 commits into from
Dec 22, 2020
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
11 changes: 8 additions & 3 deletions 11 pandas/plotting/_matplotlib/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@ def normalize(series):
df = frame.drop(class_column, axis=1).apply(normalize)

if ax is None:
ax = plt.gca(xlim=[-1, 1], ylim=[-1, 1])
ax = plt.gca()
ax.set_xlim(-1, 1)
ax.set_ylim(-1, 1)

to_plot: Dict[Label, List[List]] = {}
colors = get_standard_colors(
Expand Down Expand Up @@ -260,7 +262,8 @@ def f(t):
)
colors = dict(zip(classes, color_values))
if ax is None:
ax = plt.gca(xlim=(-np.pi, np.pi))
ax = plt.gca()
ax.set_xlim(-np.pi, np.pi)
for i in range(n):
row = df.iloc[i].values
f = function(row)
Expand Down Expand Up @@ -440,7 +443,9 @@ def autocorrelation_plot(
n = len(series)
data = np.asarray(series)
if ax is None:
ax = plt.gca(xlim=(1, n), ylim=(-1.0, 1.0))
ax = plt.gca()
ax.set_xlim(1, n)
ax.set_ylim(-1.0, 1.0)
mean = np.mean(data)
c0 = np.sum((data - mean) ** 2) / float(n)

Expand Down
17 changes: 11 additions & 6 deletions 17 pandas/tests/plotting/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,12 @@ def setup_method(self, method):
def test_autocorrelation_plot(self):
from pandas.plotting import autocorrelation_plot

_check_plot_works(autocorrelation_plot, series=self.ts)
_check_plot_works(autocorrelation_plot, series=self.ts.values)
# Ensure no UserWarning when making plot
with tm.assert_produces_warning(None):
_check_plot_works(autocorrelation_plot, series=self.ts)
_check_plot_works(autocorrelation_plot, series=self.ts.values)

ax = autocorrelation_plot(self.ts, label="Test")
ax = autocorrelation_plot(self.ts, label="Test")
self._check_legend_labels(ax, labels=["Test"])

def test_lag_plot(self):
Expand Down Expand Up @@ -132,8 +134,9 @@ def test_andrews_curves(self, iris):
from pandas.plotting import andrews_curves

df = iris

_check_plot_works(andrews_curves, frame=df, class_column="Name")
# Ensure no UserWarning when making plot
with tm.assert_produces_warning(None):
_check_plot_works(andrews_curves, frame=df, class_column="Name")

rgba = ("#556270", "#4ECDC4", "#C7F464")
ax = _check_plot_works(
Expand Down Expand Up @@ -280,7 +283,9 @@ def test_radviz(self, iris):
from pandas.plotting import radviz

df = iris
_check_plot_works(radviz, frame=df, class_column="Name")
# Ensure no UserWarning when making plot
with tm.assert_produces_warning(None):
_check_plot_works(radviz, frame=df, class_column="Name")

rgba = ("#556270", "#4ECDC4", "#C7F464")
ax = _check_plot_works(radviz, frame=df, class_column="Name", color=rgba)
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.