Monday 15 April 2013

python - Matplotlib invisible annotations -


I am currently adding some point to a graph and adding annotations to each specific point. However, on every attempt, only a subset of annotations actually appears on my screen. Other comments via debugging and prints are "there", but they are not visible for any reason right now. Is there something that I am doing wrong?

  import matplotlib.pyplot such as plt self.fig = plt.figure () self.ax = self.fig.add_subplot (111, projection = 'polar') = = [[0.2] , 1], [0.4, 1], [0.6, 1], [0.8, 1], [1, 1]] for x, y in li: point, = self.ax. The plot (x, y, marker = 'o', color = 'r', markarris = 12) annotation = self.ax.annotate ("comment goes here", xy = (x, y), xycoords = 'data' Xytext = (x, y), textcoords = 'data') self.fig.canvas.draw ()   

After some debugging, it seems that projection = 'polar ' fixes the problem and all the annotations appear. Is there something specific with polar graphs that will be due to buggy observations?

EDIT: In fact, I could increase the problem more and more .. I tried the simplified version of the program and it worked, I work on an existing structure built on the top of Matlotlib and gtk + I am doing this, so I may be unaware of some other hidden problem.

Editing 2: I have detected the problem. It seems that, in my update function, if I set the ylim for the graph (radius) to 1 (which is the same as all the points), then some annotations disappear. I do not know why, but if I leave it alone, then it works.

Enter image details here

matplotlib .__ version___ There is no repro for me at 1.3.x. Your annotation is shown in the specified position.

No comments:

Post a Comment