Skip to content

Commit

Permalink
Fix problem with markers when using style!
Browse files Browse the repository at this point in the history
  • Loading branch information
dynobo committed May 14, 2018
1 parent 03998ad commit 3cd064b
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions lmdiag/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,12 @@ def resid_fit(lm):
# Draw scatter and lowess line
plt.plot([fitted.min(), fitted.max()], [0, 0], 'k:')
plt.plot(grid, yhat, 'r-')
plt.plot(fitted, residuals, 'o', mec=edge_col, fillstyle='none')
plt.plot(fitted,
residuals,
'o',
mec=edge_col,
markeredgewidth=1,
fillstyle='none')

# Draw Annotations
for point in top_3:
Expand Down Expand Up @@ -123,7 +128,8 @@ def q_q(lm):
std_resid_sort,
'o',
mec=edge_col,
fillstyle='none')
markeredgewidth=1,
mfc='none')

# Draw Annotations
for point in top_3:
Expand Down Expand Up @@ -155,7 +161,12 @@ def scale_loc(lm):

# Draw scatter and lowess line
plt.plot(grid, yhat, 'r-')
plt.plot(fitted_vals, sqrt_abs_res, 'o', mec=edge_col, fillstyle='none')
plt.plot(fitted_vals,
sqrt_abs_res,
'o',
mec=edge_col,
markeredgewidth=1,
fillstyle='none')

# Draw Annotations
for point in top_3:
Expand Down Expand Up @@ -200,7 +211,12 @@ def resid_lev(lm):
plt.plot(x, np.negative(np.sqrt((.5 * params_len * (1 - x)) / x)), 'r--')
plt.plot(x, np.negative(np.sqrt((1 * params_len * (1 - x)) / x)), 'r--')
plt.plot(grid, yhat, 'r-')
plt.plot(leverage, std_resid, 'o', mec=edge_col, fillstyle='none')
plt.plot(leverage,
std_resid,
'o',
mec=edge_col,
markeredgewidth=1,
fillstyle='none')

# Limit y axis to actual values (otherwise contour lines disturb scale)
plt.ylim(std_resid.min() * 1.1, std_resid.max() * 1.1)
Expand Down

0 comments on commit 3cd064b

Please sign in to comment.