Skip to content

Matplotlib incompatibility #85

@Patrick-Cole

Description

@Patrick-Cole

Hi,

mtpy-v2 seems to be unable to plot using matplotlib 3.10.0 or above.

Test code:

from mtpy import MT
from mt_metadata import TF_XML
mt_object = MT(TF_XML)
mt_object.read()

plot_response = mt_object.plot_mt_response()

Error:
File "C:\work\Programming\pygmi\pygmi\mt\dataprep.py", line 1811, in _testfn
plot_response = mt_object.plot_mt_response()
File "c:\Python\WPy64-31350\python\Lib\site-packages\mtpy\core\mt.py", line 645, in plot_mt_response
plot_obj = PlotMTResponse(
z_object=self.Z,
...<3 lines>...
**kwargs,
)
File "c:\Python\WPy64-31350\python\Lib\site-packages\mtpy\imaging\plot_mt_response.py", line 116, in init
self.plot()
~~~~~~~~~^^
File "c:\Python\WPy64-31350\python\Lib\site-packages\mtpy\imaging\plot_mt_response.py", line 617, in plot
self.fig.suptitle(self.plot_title, fontdict=self.font_dict)
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "c:\Python\WPy64-31350\python\Lib\site-packages\matplotlib\figure.py", line 391, in suptitle
return self._suplabels(t, info, **kwargs)
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
File "c:\Python\WPy64-31350\python\Lib\site-packages\matplotlib\figure.py", line 377, in _suplabels
suplab = self.text(x, y, t, **kwargs)
File "c:\Python\WPy64-31350\python\Lib\site-packages\matplotlib\figure.py", line 1184, in text
text = Text(x=x, y=y, text=s, **effective_kwargs)
File "c:\Python\WPy64-31350\python\Lib\site-packages\matplotlib\text.py", line 155, in init
self.update(kwargs)
~~~~~~~~~~~^^^^^^^^
File "c:\Python\WPy64-31350\python\Lib\site-packages\matplotlib\text.py", line 197, in update
kwargs = cbook.normalize_kwargs(kwargs, Text)
File "c:\Python\WPy64-31350\python\Lib\site-packages\matplotlib\cbook.py", line 1790, in normalize_kwargs
raise TypeError(f"Got both {canonical_to_seen[canonical]!r} and "
f"{k!r}, which are aliases of one another")
TypeError: Got both 'size' and 'fontsize', which are aliases of one another

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions