1

After plotting financial data, I would like to get the current X and Y axes values, in order to plot, for instance, an additional arrow.

Plotted figure

So far I got pretty close; lets say the figure is stored in "plt"

If we do:

plt.gca().get_xticks()
plt.gca().get_yticks()

We get the ticks currently drawn in the figure:

[ 732000.,  732020.,  732040.,  732060.,  732080.,  732100., 732120.,  732140.,  732160.]
[ 0.9 ,  0.91,  0.92,  0.93,  0.94,  0.95,  0.96,  0.97,  0.98]

But how could we get the coordinates of, for instance, the last visible bar? and of the previous one?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
I want badges
  • 6,155
  • 5
  • 23
  • 38
  • 1
    Not sure if this helps, but there is [get_lines](http://matplotlib.org/api/axes_api.html#matplotlib.axes.Axes.get_lines) with an [example](http://stackoverflow.com/a/8939010/748858) – mgilson Feb 19 '14 at 07:04
  • yes, it helps a lot,since all my lines are inside the plotted area,so by checking that example an easy solution for this can be obtained :) – I want badges Feb 19 '14 at 07:34

0 Answers0