Graph is squashed in collapsible (Details/Summary) element

I have a similar problem and it was recommended to me that I set the figure height. This prevents the problem about 90% of the time but I still think an underlying bug exists somewhere.