New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
_update_patch_transform(): AttributeError: 'Rectangle' object has no attribute '_y' #2268
Comments
Do you have a simple, self-contained example that reproduces the bug? |
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). http://sscce.org/ may explain better what I'm getting at. |
@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. |
Not clear and no communications in 10mo, closing. |
I have this question:AttributeError: 'Rectangle' object has no property 'normed' #解决中文显示问题 def roll_dice():
def main():
if name=='main': so, what measures should i do to solve this problem??? |
The "normed" kwarg has been removed recently for consistency with |
Thank you very much
…------------------ 原始邮件 ------------------
发件人: "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.
|
my matplotlib version 2.1.0 The cord is: import random
import matplotlib.pyplot as plt
plt.rcParams['font.sans-serif'] = ['SimHei']
plt.rcParams['axes.unicode_minus'] = False
def roll_dice():
roll = random.randint(1,6)
return roll
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() |
@joker-wutong there's no |
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'
The text was updated successfully, but these errors were encountered: