How to get text from PyObject <matplotlib.text.Text object>

427 views
Skip to first unread message

Freddy Chua

unread,
Jul 31, 2014, 6:44:58 PM7/31/14
to julia...@googlegroups.com
I am using PyPlot to visualise my results.

Then I used locs, labels = xticks() to get the x-axis labels

but labels[1] is a PyObject <matplotlib.text.Text object> instead of a Julia String. How do I get the string out? I need to reformat the string..

-Freddy

ggggg

unread,
Jul 31, 2014, 8:03:03 PM7/31/14
to julia...@googlegroups.com

labels[1][:get_text]()


Try the above.  PyPlot hangs on my computer without drawing anything in it's window, so the text I received was just an empty string, but the corresponding function in python seemed to work.

Freddy Chua

unread,
Jul 31, 2014, 10:18:16 PM7/31/14
to julia...@googlegroups.com
This works, but I wonder why it is not documented anywhere.
Reply all
Reply to author
Forward
0 new messages