-
-
Notifications
You must be signed in to change notification settings - Fork 8k
Closed
Labels
Description
Are you aware of this issue raised by @Keepalive, fully reproducible/replicable (replicated by @QuangHoang), explained on SO at Matplotlib interfering with NumPy (on Windows) ?
Brief description
np.linalg.matrix_rank
returns unexplicable 0
s as soon as matplotlib.pyplot.plot
is called with a restricted set of linestyle
s.
Environment
Python3.7.3
numpy==1.19.2 # >=1.19.0 actually
matplotlib==3.3.3 # >=3.1.3 for what @keepalive can tell
Replication
import numpy as np
import matplotlib.pyplot as plt
import joblib as jl
linestyles = [
'solid', '-',
'dotted', # '.', => ValueError: '.'
'dashed', '--',
'dashdot', '-.',
':', '', ' '
]
for ls in linestyles:
print(26*'*', f"linestyle='{ls}'")
np.random.seed(1010)
x = np.random.rand(9, 5)
h0 = jl.hash(x)
x_vals = y_vals = np.arange(0, .5, .05)
plt.plot(x_vals, y_vals, linestyle=ls)
# plt.show()
h1 = jl.hash(x)
mr = np.linalg.matrix_rank(x)
print(
'\t', mr, (not mr)*'<---------------[!!!]'
)
print('\t', 'Has not changed:', h0 == h1)