Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to label prices #80

Open
Chadonillo opened this issue Apr 4, 2020 · 4 comments
Open

Ability to label prices #80

Chadonillo opened this issue Apr 4, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@Chadonillo
Copy link

Chadonillo commented Apr 4, 2020

This is just an idea of a little addition that I think can be useful. It would be nice to see what is the lastest value on the volume chart, price chart and also any addplots.
Example:

  • The arrows have their value as a label

  • Both charts have a white box that indicates the latest price value

show

@DanielGoldfarb
Copy link
Collaborator

Duplicate of #58

@DanielGoldfarb DanielGoldfarb marked this as a duplicate of #58 Apr 7, 2020
@DanielGoldfarb DanielGoldfarb changed the title Idea to improve in style. Ability to label prices Apr 7, 2020
@DanielGoldfarb DanielGoldfarb added the enhancement New feature or request label Apr 7, 2020
@DanielGoldfarb
Copy link
Collaborator

@Chadonillo
Brandon, It's been a while. I am reviewing older issues with the intent to prioritize the next set of enhancments for mplfinance. Please let me know if you are still interested in this. If so, may I ask where you got the animated plot that you have posted above, and if the code for generating that plot is available to review? Thank you. --Daniel

@stevenm100
Copy link

I got close by doing the following:

    y_min, y_max = ax1.get_ylim()

    #annotate
    if yest_close > last_close:
        ax1.annotate(str(round(last_close,2)), xycoords='axes fraction',  xy=(1.02, (last_close - y_min)/(y_max - y_min) ),  size=8, 
                   bbox=dict(boxstyle="larrow",pad=0.3, fc='red', ec='red'))
    else:
        ax1.annotate(str(round(last_close,2)), xycoords='axes fraction',  xy=(1.02, (last_close - y_min)/(y_max - y_min) ),  size=8,
                   bbox=dict(boxstyle="larrow",pad=0.3, fc='green', ec='green'))

It took a bit of wrangling to get the arrow in the correct location, but this is close enough for me.

@DanielGoldfarb
Copy link
Collaborator

@stevenm100 Thank you for sharing your code!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants