Skip to content

Importing matplotlib hijacks main axes class

Created by: lpsinger

I appreciate gwpy's lovely and convenient builtin visualization capabilities. However I was recently shocked to find out that importing gwpy hijacks the Matplotlib axes class and makes a whole bunch of stylistic changes, some of which I cannot undo by calling plt.rcdefaults(). Here's an example where it makes all of the linestyles in the legends appear extra-thick. This is not an rcparam settings; it's baked into the gwpy.axes.Axes class and so I cannot get rid of it!

Please at least register gwpy.axes.Axes with a projection name so that it does not globally monkeypatch Matplotlib.

Screen Shot 2019-11-25 at 21 25 24