Re: [python-users] metpy.plots.SkewT AttributeError in Fedora 35 / matplotlib-3.5.0

  • To: Ken Harris <kjh@xxxxxxxxxxx>
  • Subject: Re: [python-users] metpy.plots.SkewT AttributeError in Fedora 35 / matplotlib-3.5.0
  • From: Ryan May <rmay@xxxxxxxx>
  • Date: Wed, 3 Nov 2021 16:23:37 -0600
Hi Ken,

Well, I’m not exactly sure how Fedora 35 can ship with Matplotlib 3.5.0
considering it hasn’t been released yet (3.5.0rc1 is the latest and is a
pre-release):

    https://github.com/matplotlib/matplotlib/releases

At any rate, this is a known incompatibility between MetPy and the next
release of Matplotlib, and will be fixed in the next version of MetPy
(1.2.0), scheduled to be released in a few weeks. You can track progress on
fixing that specific issue here:

    https://github.com/Unidata/MetPy/pull/2179

Hope this helps,

Ryan


On Wed, Nov 3, 2021 at 3:37 PM Ken Harris <kjh@xxxxxxxxxxx> wrote:

>
> Just installed Fedora 35, which uses matplotlib-3.5.0 (and python 3.10),
> and metpy.plots.SkewT returns :
>
> AttributeError: 'Line2D' object has no property ''. Did you mean:
> 'minorTicks'?
>
> Full trace :
>
> $ python /tmp/skewt.py --skewtsonde oak
>> Traceback (most recent call last):
>>   File "/tmp/skewt.py", line 1391, in <module>
>>     sys.exit(main())
>>   File "/tmp/skewt.py", line 1387, in main
>>     plot0(parser.parse_args())
>>   File "/tmp/skewt.py", line 1231, in plot0
>>     subplot_skewt(fig0, 111, vtime0, args0) # skewt
>>   File "/tmp/skewt.py", line 890, in subplot_skewt
>>     skewt1 = metpy.plots.SkewT(fig0, subplot=pos0) #, rotation = 0)
>>   File
>> "/home/kjh/toolroot.d/pythonuserbase.d/lib/python3.10/site-packages/metpy/plots/skewt.py",
>> line 316, in __init__
>>     self.ax = fig.add_subplot(*subplot, projection='skewx',
>> rotation=rotation)
>>   File "/usr/lib64/python3.10/site-packages/matplotlib/figure.py", line
>> 774, in add_subplot
>>     ax = subplot_class_factory(projection_class)(self, *args, **pkw)
>>   File
>> "/usr/lib64/python3.10/site-packages/matplotlib/axes/_subplots.py", line
>> 33, in __init__
>>     self._axes_class.__init__(self, fig, [0, 0, 1, 1], **kwargs)
>>   File
>> "/home/kjh/toolroot.d/pythonuserbase.d/lib/python3.10/site-packages/metpy/plots/skewt.py",
>> line 195, in __init__
>>     super().__init__(*args, **kwargs)
>>   File
>> "/usr/lib64/python3.10/site-packages/matplotlib/_api/deprecation.py", line
>> 456, in wrapper
>>     return func(*args, **kwargs)
>>   File "/usr/lib64/python3.10/site-packages/matplotlib/axes/_base.py",
>> line 632, in __init__
>>     self.cla()
>>   File "/usr/lib64/python3.10/site-packages/matplotlib/axes/_base.py",
>> line 1249, in cla
>>     self.grid(False)  # Disable grid on init to use rcParameter
>>   File
>> "/usr/lib64/python3.10/site-packages/matplotlib/_api/deprecation.py", line
>> 299, in wrapper
>>     return func(*args, **kwargs)
>>   File "/usr/lib64/python3.10/site-packages/matplotlib/axes/_base.py",
>> line 3226, in grid
>>     self.xaxis.grid(visible, which=which, **kwargs)
>>   File
>> "/usr/lib64/python3.10/site-packages/matplotlib/_api/deprecation.py", line
>> 299, in wrapper
>>     return func(*args, **kwargs)
>>   File "/usr/lib64/python3.10/site-packages/matplotlib/axis.py", line
>> 1434, in grid
>>     self.set_tick_params(which='major', **gridkw)
>>   File "/usr/lib64/python3.10/site-packages/matplotlib/axis.py", line
>> 873, in set_tick_params
>>     for tick in self.majorTicks:
>>   File "/usr/lib64/python3.10/site-packages/matplotlib/axis.py", line
>> 592, in __get__
>>     tick = instance._get_tick(major=True)
>>   File
>> "/home/kjh/toolroot.d/pythonuserbase.d/lib/python3.10/site-packages/metpy/plots/skewt.py",
>> line 134, in _get_tick
>>     return SkewXTick(self.axes, None, label=None, major=major)
>>   File "/usr/lib64/python3.10/site-packages/matplotlib/axis.py", line
>> 415, in __init__
>>     super().__init__(*args, **kwargs)
>>   File "/usr/lib64/python3.10/site-packages/matplotlib/axis.py", line
>> 160, in __init__
>>     self.gridline = mlines.Line2D(
>>   File "/usr/lib64/python3.10/site-packages/matplotlib/lines.py", line
>> 393, in __init__
>>     self.update(kwargs)
>>   File "/usr/lib64/python3.10/site-packages/matplotlib/artist.py", line
>> 1064, in update
>>     raise AttributeError(f"{type(self).__name__!r} object "
>> AttributeError: 'Line2D' object has no property ''. Did you mean:
>> 'minorTicks'?
>
> _______________________________________________
> NOTE: All exchanges posted to Unidata maintained email lists are
> recorded in the Unidata inquiry tracking system and made publicly
> available through the web.  Users who post to any of the lists we
> maintain are reminded to remove any personal information that they
> do not want to be made public.
>
>
> python-users mailing list
> python-users@xxxxxxxxxxxxxxxx
> For list information, to unsubscribe, or change your membership options,
> visit: https://www.unidata.ucar.edu/mailing_lists/
>
-- 
Ryan May, Ph.D.
Software Engineer
UCAR/Unidata
Boulder, CO
  • 2021 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the python-users archives: