On 2012/09/03 8:33 PM, Jakob Gager wrote: > On 09/03/2012 08:57 PM, Eric Firing wrote: >> It looks like you can either use the _get_layout() method (which >> requires that you specify the renderer), or, if you know the text object >> will be among the last 50 for which _get_layout() has been called, you >> can use txt1.cached[txt1.get_prop_typ()]. >> >>> >>> Is there a different way to achieve a fitted text object? >> >> Not that I know of; but someone else may have a suggestion. >> >> Eric > > Many thanks for the quick and valuable return. I now use the _get_layout() > method and > it works like a charm :) > > Just replaced: > sf1 = 6*72./txt1.cached.items()[0][1][1][0][1][0] > with: > sf1 = 6*72./txt1._get_layout('GTKAgg')[1][0][1][0]
Jakob, What is actually happening here is that the first two lines of _get_layout() are equivalent to the second method I suggested (that's where I got the idea for that method), and the renderer argument is never being used. This is good, because the renderer argument would have to be a renderer instance, not the string name of a backend. There is also the caution that the leading underscore means _get_layout() is intended for internal mpl use only, and subject to change without notice. So, with some future version of mpl, you may need to change your code again. Eric > > br > Jakob > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users