MTgeophysics / mtpy

Python toolbox for standard Magnetotelluric (MT) data analysis
GNU General Public License v3.0
145 stars 66 forks source link

Changes in API of matplotlib 3.5 #166

Open CedricPatzer opened 2 years ago

CedricPatzer commented 2 years ago
from mtpy.core.mt import MT 

edi_file = "test.edi"
mt_obj = MT(edi_file)
pt_obj = mt_obj.plot_mt_response(plot_num=1,plot_pt='n',plot_tipper='n')

Gives error: init() got an unexpected keyword argument 'nonposx' due to: self.axp.set_xscale('log', nonposx='clip') in plot_mt_response.py

The reason is due to changes in the Matplotlib API

semilogx, semilogy, loglog, LogScale, and SymmetricalLogScale used to take keyword arguments that depends on the axis orientation ("basex" vs "basey", "subsx" vs "subsy", "nonposx" vs "nonposy"); these parameter names have been removed in favor of "base", "subs", "nonpositive". This removal also affects e.g. ax.set_yscale("log", basey=...) which must now be spelled ax.set_yscale("log", base=...).

The change from "nonpos" to "nonpositive" also affects LogTransform, InvertedLogTransform, SymmetricalLogTransform, etc.

There may be more issues further down the road