python-qinfer
python-qinfer copied to clipboard
plot_rebit_posterior raises TypeError
In plot_rebit_posterior
, the default setting is to call plot_cov_ellipse
, which uses np.linalg.eigh
to find eigenvectors of the covariance. This can return vecs
with complex entries, which then fail on line 146 of plotting_tools.py
:
theta = np.degrees(np.arctan2(*vecs[:,0][::-1]))
Should it just take the real part? as in:
theta = np.degrees(np.arctan2(*vecs.real[:,0][::-1]))
or, maybe theta = np.degrees(np.arctan2(*np.real_if_close(vecs)[:,0][::-1]))