Matplotlib Tutorial 18 - annotating last price to edge of matplotlib graph example

preview_player
Показать описание
In this Matplotlib tutorial, we're going to show an example of how we can track the last price of a stock, by annotating it to the right side of the axis like a lot of charting applications will do.

While people like to see historical prices in their live graphs, they also want to see the most recent price. What most applications do, is the annotate the last price at the y-axis height of the price, and then kind of highlight it and move it around a bit in a box of sorts as price changes. Using our recently-learned annotation tutorial, we can do this along with adding a bbox.

Рекомендации по теме
Комментарии
Автор

How to solve the problem with the moving annotation, when one moves the chart? I tried with the fraction option but, what is fine for the x-axis is not for the price axis.
Thank you in advance.

VeniVidiVici
Автор

For some reasons the annotation of the last stock price is shown on the left hand side. Any suggestions how can I fix this bad boy!

saadahmed
Автор

Again, this my by wrongheaded hairsplitting. I think this video title should be "Matplotlib Tutorial 18 - Annotating last price to edge of matplotlib graph example".

kamilziemian
Автор

I've been following this whole tutorial. Along the way I have done some things slightly different (like using Panda to retrieve yahoo API). Now when I try to annotate it is giving me this error:
ValueError: Cannot add integral value to Timestamp without freq.

Why is it doing this? What needs to be done? I would appreciate it if someone could help me with this. Here is the code:

nickt
visit shbcf.ru