Hi,
I have another case where matplotlib-1.2.1 crashes somewhere deeply.
...
draw_hist_plot('somefile.png', _mydata, _colors, _title, _xlabel, _ylabel, _legends, legend_loc=_legend_loc, legend_bbox_to_anchor=_legend_bbox_to_anchor, ymin=0, fontsize=10, dpi=100, bin_count=_bin_count)
File "myprogram.py", line 11881, in draw_hist_plot
_figure.savefig(filename, dpi=100)
File "/usr/lib64/python2.7/site-packages/matplotlib/figure.py", line 1370, in savefig
self.canvas.print_figure(_args, *_kwargs)
File "/usr/lib64/python2.7/site-packages/matplotlib/backend_bases.py", line 2096, in print_figure
*_kwargs)
File "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_agg.py", line 492, in print_png
FigureCanvasAgg.draw(self)
File "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_agg.py", line 440, in draw
self.figure.draw(self.renderer)
File "/usr/lib64/python2.7/site-packages/matplotlib/artist.py", line 54, in draw_wrapper
draw(artist, renderer, *args, *_kwargs)
File "/usr/lib64/python2.7/site-packages/matplotlib/figure.py", line 1006, in draw
func(_args)
File "/usr/lib64/python2.7/site-packages/matplotlib/artist.py", line 54, in draw_wrapper
draw(artist, renderer, *args, *_kwargs)
File "/usr/lib64/python2.7/site-packages/matplotlib/axes.py", line 2086, in draw
a.draw(renderer)
File "/usr/lib64/python2.7/site-packages/matplotlib/artist.py", line 54, in draw_wrapper
draw(artist, renderer, _args, *_kwargs)
File "/usr/lib64/python2.7/site-packages/matplotlib/patches.py", line 433, in draw
transform = self.get_transform()
File "/usr/lib64/python2.7/site-packages/matplotlib/patches.py", line 176, in get_transform
return self.get_patch_transform() + artist.Artist.get_transform(self)
File "/usr/lib64/python2.7/site-packages/matplotlib/patches.py", line 581, in get_patch_transform
self._update_patch_transform()
File "/usr/lib64/python2.7/site-packages/matplotlib/patches.py", line 574, in _update_patch_transform
y = self.convert_yunits(self._y)
AttributeError: 'Rectangle' object has no attribute '_y'
Unfortunately not, I hope you can handcraft something as you know what is the code doing. If not, please let me know and I will try to find some time, but am not very optimistic.
The problem is, I don't know what your code is doing to cause this, so I would have to go hunting to reproduce this error (which our test suite obviously doesn't find).
@mmokrejs, it is hard to see how this error could occur in normal use. The _x and _y attributes of the Rectangle are created upon initialization. The traceback indicates that the _x attribute is still there, but the _y attribute has somehow disappeared.
If you can run inside of ipython, you could use %debug for post-mortem debugging to find out where your Rectangle object came from, and whether it is missing any other attributes.
The "normed" kwarg has been removed recently for consistency with np.histogram. Use density=True instead.
In the future, please ask questions like this on the matplotlib-users mailing list or stackoverflow, and use an SSCCE (http://sscce.org/) to illustrate--strip it down to the bare minimum. Also specify the matplotlib version.
------------------ 原始邮件 ------------------
发件人: "Eric Firing"<notifications@github.com>;
发送时间: 2020年4月1日(星期三) 上午10:30
收件人: "matplotlib/matplotlib"<matplotlib@noreply.github.com>;
抄送: "吴通"<2570868576@qq.com>; "Comment"<comment@noreply.github.com>;
主题: Re: [matplotlib/matplotlib] _update_patch_transform(): AttributeError: 'Rectangle' object has no attribute '_y' (#2268)
The "normed" kwarg has been removed recently for consistency with np.histogram. Use density=True instead.
In the future, please ask questions like this on the matplotlib-users mailing list or stackoverflow, and use an SSCCE (http://sscce.org/) to illustrate--strip it down to the bare minimum. Also specify the matplotlib version.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
Activity
mdboom commented on Aug 1, 2013
Do you have a simple, self-contained example that reproduces the bug?
mmokrejs commented on Aug 1, 2013
Unfortunately not, I hope you can handcraft something as you know what is the code doing. If not, please let me know and I will try to find some time, but am not very optimistic.
mdboom commented on Aug 1, 2013
The problem is, I don't know what your code is doing to cause this, so I would have to go hunting to reproduce this error (which our test suite obviously doesn't find).
http://sscce.org/ may explain better what I'm getting at.
efiring commented on Aug 10, 2013
@mmokrejs, it is hard to see how this error could occur in normal use. The _x and _y attributes of the Rectangle are created upon initialization. The traceback indicates that the _x attribute is still there, but the _y attribute has somehow disappeared.
If you can run inside of ipython, you could use %debug for post-mortem debugging to find out where your Rectangle object came from, and whether it is missing any other attributes.
tacaswell commented on Jun 29, 2014
Not clear and no communications in 10mo, closing.
joker-wutong commented on Apr 1, 2020
I have this question:AttributeError: 'Rectangle' object has no property 'normed'
The code is :
import random
import matplotlib.pyplot as plt
#解决中文显示问题
plt.rcParams['font.sans-serif'] = ['SimHei']
plt.rcParams['axes.unicode_minus'] = False
def roll_dice():
"""
模拟掷骰子
def main():
total_times = 10
#记录骰子的结果 roll_list = [] for i in range(total_times): roll1 = roll_dice() roll2 = roll_dice() roll_list.append(roll1 + roll2) #数据可视化 plt.hist(roll_list,bins = range(2,14,1),normed = 1,edgecolor = 'green',linewidth = 1) plt.title('骰子点数统计') plt.xlabel('点数') plt.ylabel('频率') plt.show()if name=='main':
main()
so, what measures should i do to solve this problem???
efiring commented on Apr 1, 2020
The "normed" kwarg has been removed recently for consistency with np.histogram. Use density=True instead.
In the future, please ask questions like this on the matplotlib-users mailing list or stackoverflow, and use an SSCCE (http://sscce.org/) to illustrate--strip it down to the bare minimum. Also specify the matplotlib version.
joker-wutong commented on Apr 1, 2020
joker-wutong commented on Apr 8, 2020
my matplotlib version 2.1.0
I have a case :
AttributeError: 'Rectangle' object has no property 'normed'
The cord is:
story645 commented on Apr 8, 2020
@joker-wutong there's no normed keyword argument to plt.hist. It was deprecated a while back, and now the density flag is a close analogue.
https://matplotlib.org/api/_as_gen/matplotlib.pyplot.hist.html?highlight=hist#matplotlib.pyplot.hist