weixin_39628186
weixin_39628186
2020-12-29 07:05

Internal AttributeError: Unknown property facecolor

Dear nilearn-Team,

I am using your package some months now. Somehow I wasn't able to plot Nifti1 images anymore. Using and function from nilearn.plotting gives me the AttrributeError: Unknown property facecolor.

Here is the Traceback:


`Traceback (most recent call last):

  File "<ipython-input-4-01b0b33a2aaf>", line 4, in <module>
    threshold= stcdata.min(), annotate=True, title='iter _ t=%.2f ms' % (t_in_ms), cmap='n_jet')

  File "/home/daniel/anaconda2/lib/python2.7/site-packages/nilearn/plotting/img_plotting.py", line 999, in plot_stat_map
    **kwargs)

  File "/home/daniel/anaconda2/lib/python2.7/site-packages/nilearn/plotting/img_plotting.py", line 183, in _plot_img_with_bg
    colorbar=colorbar)

  File "/home/daniel/anaconda2/lib/python2.7/site-packages/nilearn/plotting/displays.py", line 513, in init_with_figure
    return cls(cut_coords, axes, black_bg, **kwargs)

  File "/home/daniel/anaconda2/lib/python2.7/site-packages/nilearn/plotting/displays.py", line 460, in __init__
    self._init_axes(**kwargs)

  File "/home/daniel/anaconda2/lib/python2.7/site-packages/nilearn/plotting/displays.py", line 922, in _init_axes
    facecolor=axisbg, aspect='equal')

  File "/home/daniel/anaconda2/lib/python2.7/site-packages/matplotlib/figure.py", line 915, in add_axes
    a = projection_class(self, rect, **kwargs)

  File "/home/daniel/anaconda2/lib/python2.7/site-packages/matplotlib/axes/_base.py", line 537, in __init__
    self.update(kwargs)

  File "/home/daniel/anaconda2/lib/python2.7/site-packages/matplotlib/artist.py", line 856, in update
    raise AttributeError('Unknown property %s' % k)

AttributeError: Unknown property facecolor`
</module></ipython-input-4-01b0b33a2aaf>

I am hoping you can tell me how to fix this, because I am using your tools very often.

Thanks in advance and greetings, Daniel

该提问来源于开源项目:nilearn/nilearn

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

9条回答

  • weixin_39710561 weixin_39710561 4月前

    Did you update matplotlib recently? What version are you using?

    点赞 评论 复制链接分享
  • weixin_39867893 weixin_39867893 4月前

    Along with the version of matplotlib as Gael asked. Could you please also give us some script to reproduce the error ? It would make us easy to see what is going on. Thanks for the minimal reproducible script.

    点赞 评论 复制链接分享
  • weixin_39628186 weixin_39628186 4月前

    I did "update" matplotlib recently. I am using matplotlib 2.0.2 now. I already solved the problem myself. But somehow another, different Error pops up.

    Just by trying to import nilearn.plotting the Traceback looks like this

    
    from nilearn import plotting
    Traceback (most recent call last):
    
      File "<ipython-input-18-35cd2f5e057b>", line 1, in <module>
        from nilearn import plotting
    
      File "/home/daniel/anaconda2/lib/python2.7/site-packages/nilearn/plotting/__init__.py", line 38, in <module>
        from . import cm
    
      File "/home/daniel/anaconda2/lib/python2.7/site-packages/nilearn/plotting/cm.py", line 144, in <module>
        _cmaps_data['ocean_hot'] =  _concat_cmap(_cm.ocean, _cm.hot_r)
    
      File "/home/daniel/anaconda2/lib/python2.7/site-packages/nilearn/plotting/cm.py", line 70, in _concat_cmap
        colors = cmap1(ps)
    
      File "/home/daniel/anaconda2/lib/python2.7/site-packages/matplotlib/colors.py", line 487, in __call__
        cbook._putmask(xa, xa == 1.0, almost_one)
    
    AttributeError: 'module' object has no attribute '_putmask'
    </module></module></module></ipython-input-18-35cd2f5e057b>

    Unfortunately the minimal reproducible script only contains one line: from nilearn import plotting

    Thanks for your assistance, Daniel

    点赞 评论 复制链接分享
  • weixin_39867893 weixin_39867893 4月前

    Does this helps to you ? https://github.com/nilearn/nilearn/issues/1269

    点赞 评论 复制链接分享
  • weixin_39628186 weixin_39628186 4月前

    I don't want to reinstall nilearn, but I will give it a try. Furthermore, I remind you that the problem is not importing nilearn.plotting, but that there is something wrong with a module.

    点赞 评论 复制链接分享
  • weixin_39628186 weixin_39628186 4月前

    Solved the problem. Since the problem was a false/defect module I went for: 1. Uninstall matplotlib 2. Uninstall nilearn and then installed all again. There really was a dependecy issue with nilearn and matplotlib.

    Nevertheless, I thank you for your help.

    点赞 评论 复制链接分享
  • weixin_39867893 weixin_39867893 4月前

    Just curious, which matplotlib version have you updated ?

    点赞 评论 复制链接分享
  • weixin_39867893 weixin_39867893 4月前

    Can you close this issue if everything seems OK ?

    点赞 评论 复制链接分享
  • weixin_39628186 weixin_39628186 4月前

    Everything seems okay. I am using matplotlib version 2.1.0.

    点赞 评论 复制链接分享

相关推荐