From: Peter W. <pw...@go...> - 2012-06-13 12:28:15
|
Hello, I'm searching for a way to extract all text elements from a matplotlib figure including their positions, styles, alignments etc. I first tried to write a custom backend and to fetch all the texts from the "draw_text()" method of the renderer. In contrast to the documentation "draw_text()" does not receive a matplotlib.text.Text instance with all the necessary information but only a simple string and a pre-layouted position. So I found this "findobj" method to get all Text elements from a figure in a list, which is exactly what I was looking for. However, I get some weird duplicates for all the tick labels and I don't know how to handle them. This is a small example that uses findobj on the axis objects and prints the texts. http://old.nabble.com/file/p34004789/duplicate_ticks.py On all my matplotlib installations, all tick labels have duplicates positioned at the end of the axis. Why? How to filter them out from a list of Text elements? Their get_visible() attribute is True. Another thing is that I first had to do a "draw()" call in order to have the ticks generated/updated at all. How do I force an update of the tick labels. Colorbar seems to have a "update_ticks()" method, but I can't find something similar for the axis ticks. -- View this message in context: http://old.nabble.com/Duplicate-Ticks-tp34004789p34004789.html Sent from the matplotlib - users mailing list archive at Nabble.com. |