usnistgov / mass

Microcalorimeter pulse-analysis software
MIT License
6 stars 0 forks source link

plot_average_pulses() and plot_filters() not working #186

Closed joefowler closed 4 years ago

joefowler commented 4 years ago

Original report by Dan Becker (Bitbucket: danbek, GitHub: danbek).


Going against master, neither plot_average_pulses() nor plot_filters() are working for me. I don’t know whether this is really a bug in MASS, or a problem with my setup.

Here are the errors:

In [3]: data.plot_average_pulses()

Traceback (most recent call last):
  File "/home/beckerd/installs/anaconda3/envs/mass.fabian/lib/python3.8/site-packages/matplotlib/bac
kends/backend_qt5.py", line 508, in _draw_idle
    self.draw()
  File "/home/beckerd/installs/anaconda3/envs/mass.fabian/lib/python3.8/site-packages/matplotlib/bac
kends/backend_agg.py", line 388, in draw
    self.figure.draw(self.renderer)
  File "/home/beckerd/installs/anaconda3/envs/mass.fabian/lib/python3.8/site-packages/matplotlib/artist.py", line 38, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)
  File "/home/beckerd/installs/anaconda3/envs/mass.fabian/lib/python3.8/site-packages/matplotlib/figure.py", line 1708, in draw
    mimage._draw_list_compositing_images(
  File "/home/beckerd/installs/anaconda3/envs/mass.fabian/lib/python3.8/site-packages/matplotlib/image.py", line 135, in _draw_list_compositing_images
    a.draw(renderer)
  File "/home/beckerd/installs/anaconda3/envs/mass.fabian/lib/python3.8/site-packages/matplotlib/artist.py", line 38, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)
  File "/home/beckerd/installs/anaconda3/envs/mass.fabian/lib/python3.8/site-packages/matplotlib/axes/_base.py", line 2647, in draw
    mimage._draw_list_compositing_images(renderer, self, artists)
  File "/home/beckerd/installs/anaconda3/envs/mass.fabian/lib/python3.8/site-packages/matplotlib/image.py", line 135, in _draw_list_compositing_images
    a.draw(renderer)
  File "/home/beckerd/installs/anaconda3/envs/mass.fabian/lib/python3.8/site-packages/matplotlib/artist.py", line 38, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)
  File "/home/beckerd/installs/anaconda3/envs/mass.fabian/lib/python3.8/site-packages/matplotlib/lines.py", line 783, in draw
    lc_rgba = mcolors.to_rgba(self._color, self._alpha)
  File "/home/beckerd/installs/anaconda3/envs/mass.fabian/lib/python3.8/site-packages/matplotlib/col
ors.py", line 177, in to_rgba
    rgba = _to_rgba_no_colorcycle(c, alpha)
  File "/home/beckerd/installs/anaconda3/envs/mass.fabian/lib/python3.8/site-packages/matplotlib/col
ors.py", line 240, in _to_rgba_no_colorcycle
    raise ValueError("Invalid RGBA argument: {!r}".format(orig_c))
ValueError: Invalid RGBA argument: [(0.0, 0.0, 0.0, 1.0)]

In [4]: data.plot_filters()
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-4-2c8fb79d9fac> in <module>
----> 1 data.plot_filters()

~/installs/anaconda3/envs/mass.fabian/lib/python3.8/site-packages/mass-0.7.4-py3.8-linux-x86_64.egg/mass/core/channel_group.py in plot_filters(self, axis, channels, cmap, filtname, legend)
   1017                 continue
   1018             ds = self.channel[channum]
-> 1019             plt.plot(ds.filter.__dict__[filtname], label="Chan %d" % channum,
   1020                      color=cmap(float(ds_num) / len(channels)))
   1021

AttributeError: 'NoneType' object has no attribute '__dict__'

joefowler commented 4 years ago

Original comment by Joseph Fowler (Bitbucket: joe_fowler, ).


I get the same error. I’m sure it’s some change in matplotlib. I’ll work on it.

joefowler commented 4 years ago

Original comment by Joseph Fowler (Bitbucket: joe_fowler, ).


Remove all color=[x] usage

This was all an error in understanding newer matplotlib, similar to the #186 issue. Fixes #186.

joefowler commented 1 year ago

Original comment by Joseph Fowler (Bitbucket: joe_fowler, ).


Removing milestone: v0.7 (automated comment)