csinva / imodels

Interpretable ML package 🔍 for concise, transparent, and accurate predictive modeling (sklearn-compatible).
https://csinva.io/imodels
MIT License
1.4k stars 124 forks source link

Importing imodels changes default matplotlib plot size config #164

Closed davidefiocco closed 1 year ago

davidefiocco commented 1 year ago

Executing import imodels influences the way matplotlib plots are displayed subsequently.

To reproduce, run

import matplotlib.pyplot as plt
import numpy as np
# import imodels

x = np.arange(0, 10, 0.01)
y = np.sin(x)
plt.plot(x, y)

with the import commented and uncommented. Plot size will be (very) different, like below:

size-comparison

Expected behavior (I think) would be the import statement not to affect the appearance of figures. This is a bit annoying as the display size is disproportionately large e.g. when using a Jupyter notebook. I'm on imodels==1.3.15.

csinva commented 1 year ago

Thanks for catching this! You're right this is bad behavior, just pushed a fix in dba8ba1 and bumped the imodels version