python-qinfer
python-qinfer copied to clipboard
Issues plotting covariance estimation_results['posterior'].plot_covariance()
When trying to plot covariance I ran into the following issue
~\AppData\Local\Continuum\Anaconda3\envs\qsharp-samples\lib\site-packages\qinfer\smc.py in plot_covariance(self, corr, param_slice, tick_labels, tick_params)
1159 cov = self.est_covariance_mtx(corr=corr)[param_slice, param_slice]
1160
-> 1161 retval = mpls.hinton(cov)
1162 plt.xticks(*tick_labels, **(tick_params if tick_params is not None else {}))
1163 plt.yticks(*tick_labels, **(tick_params if tick_params is not None else {}))
~\AppData\Local\Continuum\Anaconda3\envs\qsharp-samples\lib\site-packages\mpltools\special\hinton.py in hinton(inarray, max_value, use_default_ticks)
54
55 ax = plt.gca()
---> 56 ax.set_axis_bgcolor('gray')
57 # make sure we're working with a numpy array, not a numpy matrix
58 inarray = np.asarray(inarray)
AttributeError: 'AxesSubplot' object has no attribute 'set_axis_bgcolor'
https://github.com/QInfer/python-qinfer/blob/e90cc57d50f1b48148dbd0c671eff6246dda6c31/src/qinfer/smc.py
Recent versions of matplotlib have replaced it by set_facecolor. Mpltools uses the old attribute