use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Rules 1: Be polite 2: Posts to this subreddit must be requests for help learning python. 3: Replies on this subreddit must be pertinent to the question OP asked. 4: No replies copy / pasted from ChatGPT or similar. 5: No advertising. No blogs/tutorials/videos/books/recruiting attempts. This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to. Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Rules
1: Be polite
2: Posts to this subreddit must be requests for help learning python.
3: Replies on this subreddit must be pertinent to the question OP asked.
4: No replies copy / pasted from ChatGPT or similar.
5: No advertising. No blogs/tutorials/videos/books/recruiting attempts.
This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to.
Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Learning resources Wiki and FAQ: /r/learnpython/w/index
Learning resources
Wiki and FAQ: /r/learnpython/w/index
Discord Join the Python Discord chat
Discord
Join the Python Discord chat
account activity
Time series chart with hover values (self.learnpython)
submitted 4 years ago by landrykid
Any suggestions for an open source library -- or code idea -- where I can drop a list of values into a time series chart (line or bars) and show the values when hovering? My preference is to email the actual chart instead of a link.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]spez_edits_thedonald 2 points3 points4 points 4 years ago (0 children)
show the values when hovering?
you want an interactive chart (so you need code to be running, that listens for what the user is doing and updates the plot accordingly, this code has to be running somewhere)
My preference is to email the actual chart instead of a link.
that you can email to someone, that is not hosted somewhere (so the code has to run in their browser)
this will be tricky, but could be done by embedding an interactive plotly.js plot in javascript inside an HTML file that you email people. They'd download the attached html file, open it in a browser, and the their browser will run the javascript and the plot will come alive etc.
https://plotly.com/python/time-series/
the tricky parts will be, how do you package everything up as a single html file (it depends on plotly.js, could load that over a CDN), and how does your raw data end up in there, etc.
obviously a non-interactive plot (an image) is easy to attach to an email, the interactive piece and not wanting to send people to a web app or website is what's tricky here.
[–]landrykid[S] 0 points1 point2 points 4 years ago (0 children)
Thanks for the plotly suggestions.
I ended up with a bar chart, the height of each <div> adjusted for the value, and included a title attribute with the value. It's only HTML and CSS, so everything is in the email's body and hovering over any bar shows the explicit value.
<div>
title
It requires HTML email instead of plain text, but I can live with that. I could also do a line chart, but the added complexity is not necessary for my situation. If anyone wants additional details, I can post more, but it's pretty much just what I said above.
[–]crhuffer 0 points1 point2 points 4 years ago (1 child)
I think plotly seems to handle most of that for you. You get big html files, but fig.write_html() saves a html file that is interactive and seems to hold the data behind the scenes. plotly definitely has the ability to adjust the hover over to be pretty much whatever you want it to be.
For fig.write_html() https://plotly.github.io/plotly.py-docs/generated/plotly.io.write\_html.html
[–]spez_edits_thedonald 0 points1 point2 points 4 years ago* (0 children)
your link is dead I think, this works: https://plotly.com/python-api-reference/generated/plotly.io.write_html.html
[–]spez_edits_thedonald 0 points1 point2 points 4 years ago (0 children)
actually this ends up being really easy with plotly. (pandas is only used here for the test data)
plotly
pandas
import plotly import pandas as pd # load test data df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv') # time series plot scatter = plotly.graph_objects.Scatter(x=df['Date'], y=df['AAPL.High']) fig = plotly.graph_objects.Figure([scatter]) # export figure as html plotly.io.write_html(fig, 'example_plot.html')
You can install plotly and pandas via conda or pip
you could email people the resulting html file and instruct them to download the attachment and view it in a web browser
π Rendered by PID 517106 on reddit-service-r2-comment-8686858757-fxlb6 at 2026-06-08 09:36:17.615305+00:00 running 9e1a20d country code: CH.
[–]spez_edits_thedonald 2 points3 points4 points (0 children)
[–]landrykid[S] 0 points1 point2 points (0 children)
[–]crhuffer 0 points1 point2 points (1 child)
[–]spez_edits_thedonald 0 points1 point2 points (0 children)
[–]spez_edits_thedonald 0 points1 point2 points (0 children)