I have a plot from hierarchy clustering, the x ticks is the observation index after the clustering. How can I added the label so that i can link the original observation name linked to the index instead of showing a list of index number (e.g. [11, 6 ,18, 3 5, 12....]). For histogram, I can assign the label via list of string since the index would always be 1,2,3...4, but for the plot after clustering the observation index would change ... Is there any objects or function I can use?
Asked
Active
Viewed 256 times
0
-
All the tick/label functionality is taken care of by the `ticker` module http://matplotlib.org/api/ticker_api.html . I would look there. I don't understand your question well enough to provide much more help. – tacaswell Feb 01 '13 at 19:51
-
eh...Thanks! in order to explain my question a little bit ..please see http://stackoverflow.com/questions/2982929/plotting-results-of-hierarchical-clustering-ontop-of-a-matrix-of-data-in-python/3011894#3011894 ...for the dendragram on the top and right I need to provide the x-axis(top subplot, and y2 -axis for the right subplot) with the original observation names/ not the original tick-labels – user1830108 Feb 01 '13 at 20:13
-
well to be more specify ...I used the get_xticklab ..then I can get a list print out like: text[(1, 0, '11')] the '11' here is my index. but the str.split and str.slice is not working here to get the index '11' and it will report it is a text object.. so how can i change it into text[(1, 0, function(11)] ? – user1830108 Feb 01 '13 at 21:21
-
You should add these details to the question (by editing it). It is very hard to read your code in the comments. – tacaswell Feb 01 '13 at 21:32
-
Thanks a lot for helping ! I thins there is a similar poster ^-^ . I know the answer now ! http://scipy-lectures.github.com/intro/matplotlib/matplotlib.html#setting-ticks – user1830108 Feb 01 '13 at 21:35
-
Congratulations for solving your own problem! For the benefit of future users could you answer your own question (and accept it when you can)? – tacaswell Feb 01 '13 at 21:45