Skip to content

Commit

Permalink
BUG: Fixes axes limit for PredictionError plot #1193 (#1208)
Browse files Browse the repository at this point in the history
Co-authored-by: Pkaf <[email protected]>
  • Loading branch information
pkaf and prajwalk-sportsbet authored Feb 18, 2022
1 parent 838063e commit 20acdcc
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 5 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 6 additions & 5 deletions yellowbrick/regressor/prediction_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,12 +216,13 @@ def draw(self, y, y_pred):
label="best fit",
)

# Set the axes limits based on the range of X and Y data
# Set the axes limits based on the overall max/min values of
# concatenated X and Y data
# NOTE: shared_limits will be accounted for in finalize()
# TODO: do better than add one for really small residuals
self.ax.set_xlim(y.min() - 1, y.max() + 1)
self.ax.set_ylim(y_pred.min() - 1, y_pred.max() + 1)

if self.shared_limits is True:
self.ax.set_xlim(min(min(y), min(y_pred)), max(max(y), max(y_pred)))
self.ax.set_ylim(self.ax.get_xlim())
return self.ax

def finalize(self, **kwargs):
Expand Down

0 comments on commit 20acdcc

Please sign in to comment.