Created
August 7, 2022 21:31
-
-
Save ugik/f68afb2147fc4884589205debcf84c14 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
file = "stats.jpg" | |
# create your own numerical lists here... | |
days = [30, 21, 14, 5, 2] | |
data = [10, 19, 6, 34, 12] | |
labels = days | |
plt.xticks(range(len(data)), labels) | |
plt.xlabel('Days') | |
plt.ylabel('% Position Gain') | |
plt.title('Gains Summary') | |
plt.bar(range(len(data)), data) | |
plt.savefig(file, bbox_inches='tight') | |
plt.show() | |
plt.close() | |
url = f"https://api.telegram.org/bot{TELEGRAM_BOT_KEY}/sendPhoto" | |
files = {} | |
files["photo"] = open(file, "rb") | |
requests.get(url, params={"chat_id": TELEGRAM_CHAT_ID}, files=files) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment